Which platform to use Java or .NET? Developers ask this question all the time. Java has been widely adopted because of its overwhelming benefits on the server side, but Java has less to offer on the client side. .NET has made inroads into the enterprise by leveraging its stronger rich-client capabilities. An alternative solution for enterprise-scale Internet application development is the emerging XML-based rich-client technology.

.NET Erosion from the Client Side
There are good reasons why Java is the platform of choice for server-side computing. J2EE is an open standards-based platform that enables open integration. Java enjoys broad industry support, including vendors like IBM, Sun, and Oracle, as well as upstarts like Nexaweb and Sonic Software. J2EE is cross-platform, giving customers the freedom to deploy in different environments. It has proven enterprise strength. By comparison, .NET has obvious limitations. It is limited to Windows deployment only; it's a single-vendor solution, and lacks industry support from other vendors to meet enterprise requirements.

On the other hand, .NET has stronger client-side capabilities than Java. Java AWT is based on an architecture that offers limited out-of-box capabilities. Java Swing offers better out-of-box functionality, but it's complex and difficult to use. It is possible to develop Java applications with a rich look-and-feel using AWT or Swing, but complexity and developer skills requirements are high. By contrast, the barriers to developing strong .NET client applications are lower. Your typical corporate developer can easily write sophisticated VB.NET desktop applications with a professional look-and-feel.


Watch Coach Wei, author of this article, live on SYS-CON.TV

Another option is to develop thin-client applications using HTML. HTML applications are "zero-install" thin-client applications, while both Java and .NET client apps have a heavy client-side footprint and require a significant download. Besides solving network bandwidth issues, "zero-install" translates directly into lower maintenance and support costs. The skill set requirements and complexity of HTML is much lower than either .NET and Java. Unfortunately, HTML isn't suitable for handling the level of complexity, scale, and time-sensitivity required by enterprise programs. For applications with non-linear workflow, complex integration, large data sets, or time criticality, Java or .NET rich clients have been the only viable options.

Most business applications are user-oriented. Client-side issues such as look-and-feel, richness, and performance directly impact business user productivity. As a result, client-side choice can influence server-side architecture decisions. Because Java doesn't have a compelling solution on the client side, many applications are written with .NET. Eventually this could lead to a greater adoption of .NET for easier integration and management, eventually eroding J2EE's market share.

XML Rich Client
Now there's an alternative. XML rich client-technology serves rich-client applications on-demand by using XML from J2EE or Service Oriented Architecture (SOA) environments. Using XML rich-client technology, J2EE can deliver enterprise Java applications with higher performance than .NET - not only visually and functionally richer, but easier to deploy and maintain, with a thinner footprint, faster performance, greater scalability, and lower complexity.

Sample XML-Based Rich Client Technology Code
With XML rich-client technology, Web developers can build and deploy Web applications with the same richness and performance as the best Java Swing or .NET client apps without losing the "zero-install" and "universal delivery" advantages of HTML. The difference is that an XML-based rich-client application would send out XML to the client side, which is processed by the software's client, instead of HTML being processed by a browser, as in a normal Web application.

Figure 1 shows a sample form. The code behind it is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<dialog height="212" title="Sample Form" width="275">
   <layoutmanager layout="nulllayout"/>
   <tabbox borderstyle="null" height="168" width="248" x="8" y="8">
    <tab text="tabPage1">
    <panel>
     <layoutmanager layout="nulllayout"/>
     <label height="23" text="Please Enter Your Card Number Below:"
     width="224" x="6" y="24"/>
     <textbox height="20" text="" width="216" x="8" y="48"/>
     <button height="25" text="OK" width="60" x="170" y="100"/>
     </panel>
    </tab>
    <tab text="tabPage2"/>
   </tabbox>
</dialog>

Figure 2 shows a sample chart. In normal Web apps, such charts are generated as static GIF images that are sent to the browser for display. With XML-based rich-client technology, XML can be sent directly to the client:

<?xml version="1.0" encoding="UTF-8"?>
<dialog title="Auto-resizable Chart Example" bordercolor="blue" width="534"
height="325">
   <layoutmanager layout="borderlayout"/>
   <chart layoutpos="center">
    <content>
    <series points="200,100,400,300,200,200,100,400,300,200" stroke="red"
    type="line"/>
    <series points="300,200,100,200,400,300,200,100,200,400"     stroke="blue"
    type="line"/>
    </content>
    <valueaxis/>
    <labelaxis fgcolor="red"/>
    <legend/>
   </chart>
</dialog>

The Benefits of XML Rich Client Technology

  • The Future is XML - The rapid adoption of XML for server-side computing makes XML a natural candidate for client-side computing. Even Microsoft has made a commitment to this trend. The next-generation Windows, Longhorn, will support the use of XML for Windows desktop applications.
  • XML Rich-Client Technology Significantly Lowers Application Complexity and Skill Set Requirements - One benefit of XML rich-client technology is that it enables enterprise-class Internet applications while lowering development/maintenance complexity. XML rich-client technology uses the power of XML, which is more efficient and extensible than procedural programming languages like Java, C#, C++, or JavaScript. Code created in XML is simpler, takes up fewer lines, and is easier to read and process. Someone with HTML skills can easily understand the code, while C# code and Java Swing code require intimate knowledge of Object-Oriented programming.


Take the form below as an example. To create this form takes about 70 lines of C# code using Visual Studio .NET, but only 17 lines of XML code using an XML-based rich-client technology. On top of that, XML code is much easier to read, and can be processed and understood by someone with HTML skills. Both C# code and Java Swing code require intimate knowledge of Object-Oriented programming. The skill set requirement is considerably higher.

Here is the Visual Studio.NET C# code needed to create the form previously shown in Figure 1:

this.tabControl1 = new System.Windows.Forms.TabControl();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.button1 = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.SuspendLayout();

this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage2);
this.tabControl1.Location = new System.Drawing.Point(8, 8);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(248, 168);
this.tabControl1.TabIndex = 0;

this.tabPage1.Controls.Add(this.label1);
this.tabPage1.Controls.Add(this.textBox1);
this.tabPage1.Controls.Add(this.button1);
this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Size = new System.Drawing.Size(240, 142);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "tabPage1";

this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Size = new System.Drawing.Size(288, 230);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "tabPage2";

this.button1.Location = new System.Drawing.Point(152, 104);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "OK";

this.textBox1.Location = new System.Drawing.Point(8, 48);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(216, 20);
this.textBox1.TabIndex = 1;
this.textBox1.Text = " ";

this.label1.Location = new System.Drawing.Point(8, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(224, 23);
this.label1.TabIndex = 2;
this.label1.Text = "Please Enter Your Card Number Below:";
this.label1.Click += new System.EventHandler(this.label1_Click);

this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(264, 187);

this.Controls.Add(this.tabControl1);
this.Name = "Form1";
this.Text = "Sample Form";
this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.ResumeLayout(false);

  • XML Rich Client Technology Enables Richer, Thinner, Faster Applications - Enterprise Internet Applications built using XML rich-client technology can be normal J2EE Web applications, but send XML to the client side instead of HTML. However, because of XML rich-client technology, they are richer, faster, and consume up to 90% less bandwidth. No client installation is required. These applications can run instantly on different browsers and PDA devices with the same functionality as Windows desktop applications, with user interface elements like multiple windows, menu bars, toolbars, and hierarchical trees.

    For example, an enterprise management "dashboard" application built with XML rich-client technology can use sliding tabs to display tabular data as well as rich graphics and interactive charts, all updated in real-time via server push without the clunky "click-refresh" associated with normal HTML applications.

    Applications of this nature are usually built using .NET or Win32 and require heavy download/installation. Using XML rich-client technology, they are lightweight, zero-install Web applications with lower bandwidth consumption and better performance.

  • XML Rich Client Technology Seamlessly Extends J2EE - With XML rich-client technology, developers can still use JSP, tag libraries, servlet, struts, and other approaches for server-side presentation, EJB for server-side business logic, and any persistency layer for data storage. The application is deployed as a normal WAR/EAR file and managed as a normal Web application.

Conclusion
Combining XML rich-client technology with J2EE provides the following benefits compared to .NET:

  • Enterprise-scale rich-client capability and complex workflow, scalable for large data sets and high transaction rates such as hundreds of messages per second.
  • Zero-install capability with deployment/management advantages similar to HTML. While .NET applications can only be deployed to Windows XP desktops, XML rich client technology applications can be deployed hassle-free to over 95% of all desktops with any 4.0+ browser.
  • XML rich-client technology working in concert with J2EE gives Web applications the "out-of-box" capability to seamlessly enable server push, reliable messaging, pub/sub, broadcasting and guaranteed order delivery. Built-in compression, incremental update, and distributed state management minimize network traffic and increase performance.

Using XML rich-client technology, companies can develop enterprise Internet applications that match desktop quality with higher performance, and still enjoy a J2EE server infrastructure: centrally managed and deployed, automatically updated, bandwidth and network efficient, with enterprise-level J2EE security, scaling, and broad industry support.

posted on 2005-10-15 10:33  java  阅读(633)  评论(0编辑  收藏  举报