Adversaries and Partners
Compare and contrast J2EE and Microsoft .Net. Do their development and deployment technologies compete, or is there plenty to go around?
by by Chris Schalk

October 18, 2005

We hear a lot of discussion these days about service-oriented architecture (SOA), seamless integration, interoperability, Web services, and business logic and processes and what they mean for enterprises. Many resources document the comparisons and distinctions of the development and deployment technologies on both Java 2 Platform, Enterprise Edition (J2EE) and Microsoft .Net. Are these two platforms really competing against one another? Or, are they both integral to achieving interoperability in the enterprise? Let's take a look at both of these technologies, compare and contrast some of their features, and maybe dispel some of the long-held stereotypes associated with each.

One long-held stereotype for Java and J2EE developers, in fact, is that they tend to be more technically inclined and have considerably more core programming expertise. This sentiment is bolstered by a common belief like: "they have to be more skilled in computer science to work with the complexities of J2EE!" Is J2EE a technology meant only for computer scientists?

While it is true that there are complexities involved in many facets of J2EE technology, the same could be said about some of the advanced aspects of .Net. Another reason why J2EE sometimes gets a bad rap for complexity is that it is largely seen as a server-oriented technology, which is definitely a more difficult area of computer science in general. Typically, this technology involves developing nonvisual, back-end code to process large amounts of data such as back-end business logic for large-scale, industrial applications.

However, to J2EE's credit, it has recently made significant strides into more client-related software development. One key, recent change in J2EE has been a rise of increasingly powerful Java integrated development environments (IDEs) as well as some key new Web client development technologies that are geared more toward corporate developers as opposed to the traditional systems or component developers.

The Rise of J2EE IDEs
In the past few years Java and J2EE developers have had an ever-improving set of tools to help them develop a vast array of J2EE technologies. More sophisticated and powerful Java IDEs have lowered the technical bar for Java developers and allowed a larger population of business developers into the Java arena. While Java IDEs aren't necessarily a new phenomenon, recently there has been a marked increase in developer productivity provided in the latest Java IDEs. For example, some of the new tools such as the open source Eclipse and NetBeans along with Oracle JDeveloper and Intellij Idea now provide a long list of extremely powerful Java productivity development features (see Figure 1). These features include code refactoring, code completion, automatic indenting and formatting, collapsible edit regions (or code folding), and code profiling. The new, more powerful IDEs also have features that provide integration with many external open source development technologies such as Apache Ant, CVS, and Jakarta Struts.

In addition to offering core Java coding, Java IDEs have branched out and begun offering more visual development tools, including support technologies like Unified Modeling Language (UML), Struts Page Flow, and JavaServer Pages (JSP) visual design (see Figure 2).

The other important event that has increased awareness of J2EE IDEs is that they are either free or are very cheap. Both the core development platforms Eclipse and NetBeans are open source and are free. However, more feature-complete IDEs that are built on top of the Eclipse platform are for sale, though usually at modest prices. In a recent announcement at JavaOne 2005, Oracle announced that its Java IDE, JDeveloper, is now completely free of charge.

One of the newest areas of J2EE technologies to help break the mold of J2EE being a nonvisual, server-centric technology is JavaServer Faces (JSF). JSF is a new Web user interface development framework that is part of the standard J2EE technology. Its goal is to provide a single, standard, and component-centric way to build Web user interfaces productively for J2EE applications. This J2EE technology has also led to great innovations with J2EE IDEs, with new visual development support now being offered in several Java IDEs. We'll discuss a more thorough comparison shortly, but first let's have a look at what's currently hot with the .Net technology.

Is .Net Always Easier?
Looking to stay in the lead in the traditional client-oriented software development arena, Microsoft has been busy working on their entire .Net development infrastructure with its Windows Vista project (formally known as LongHorn). Windows Vista has been in development for a long time (since 2003), but it's nearing completion and is expected to be released in 2006. Some of the new technology currently being beta tested and previewed is Microsoft's next-generation IDE: Visual Studio 2005.

Visual Studio 2005 is Microsoft's slickest development tool yet. It is armed with many developer-productivity features. The new ASP 2.0 visual controls provided in Visual Studio 2005 simplify many common Web development tasks by reducing substantially the amount of manual coding required by the application developer.. Another big feature in the new .Net release is its new team development features where the entire life cycle of development, from initial design, prototyping, coding, and unit testing to completion, is handled in a distributed environment.

Microsoft has always strived for lowering the technical bar for the larger development community of corporate developers; however, when it comes to more advanced development, people still contend that Microsoft enterprise development can be just as complex as J2EE. Another important factor is that although there are some very compelling development features provided with Microsoft's latest offerings, developers have to be comfortable with the fact that their applications will reside entirely on a Microsoft technology stack. The only exception is when Web services are used to communicate out of the stack to other services that could be running on any platform. We'll discuss more about this topic shortly.

To sum up, both the J2EE and Microsoft camps have been extremely busy retooling their architectures to enable larger portions of development communities. J2EE has a new host of J2EE IDEs that offer tremendous features for little or no cost, while Microsoft is banking on delivering a "best of quality" technology suite that all works together in a cohesive manner—providing its Microsoft technology.

Now that we've discussed some of the key aspects of both J2EE and .Net, let's take a look at some of the technologies that are very similar on both platforms and see exactly how each stacks up against the other. To begin this in-depth comparison, let's look at the component technologies JSF and Microsoft ASP.Net by comparing them directly and their respective development environments.

Since ASP has been available in the public for a longer period of time, there has been a large external development community providing an increasing amount of Web components, or to use Microsoft's terminology: controls. With the Vista release, Microsoft is also revamping their component/control technology with ASP 2.0. It is intended to be even easier to develop with than previous versions of ASP. The overriding theme for ASP 2.0 is "less coding," and less coding is achieved by making the controls themselves more intelligent, thus reducing the amount of manual coding required to customize.

This direction is logical: can you imagine if we still had to start our car engines with a hand crank? An example of ASP 2.0's improvement is evident with their new GridView control. It is more powerful than its predecessor, the DataGrid, and requires less manual coding to build a grid of data, which could be from a variety of sources, that can be scrolled, paged, sorted by column, and edited. In general, GridView, along with the other 2.0 controls, is enhanced with the vision of better productivity and less manual coding. The controls also use Visual Studio's Smart Tasks popup editors, which make them easily customizable.

In addition to ASP 2.0 enhancements, ASP has always benefited from a thriving development community that has provided many libraries of useful complementary controls in many different areas, including charting, imaging, XML, forums, and many others. These ASP libraries are easily found on Microsoft's official ASP.Net Web site (see Resources), which serves as a vast registry of numerous rich and diverse ASP controls and affiliated ASP community sites. In short, the ASP development community is thriving.

For the Business Developer
As mentioned previously, JSF is J2EE's new, standard Web user interface technology. Its goal is to simplify the often complicated task of building a robust Web user interface to the back-end business logic by offering a component-centric development approach. Working with intelligent Web components, as opposed to writing low-level code to construct Web applications, opens J2EE Web development to new audiences who may be slightly less technical but are more focused on the business aspects of application development.

The introduction of the JSF API in early 2004 offered both a specification and a reference implementation. The reference implementation included a set of base Web components (UI components) that covered the basics of Web development, in that they provided a set of core components to assemble Web applications. This set included components for building basic Web UIs with input fields, buttons, links, and a basic table or grid component to render tabular data.

Although the base components provided in the initial specification offered the basics, what was more important was that the specification itself was very flexible, and the intent was that the larger Java community would begin complementing the initial set of base components with much more powerful and specialized components, thus leading to more developer productivity. This intention has largely been achieved based on the growing community of JSF component developers. Some examples of external JSF component development providers include:

  • Apache MyFaces – An open source JSF component library and a JSF implementation that provides a more advanced set of useful Web components, including scrollable data tables, trees, tab bars, and so on.
  • Oracle ADF Faces – Oracle has rewritten its UIX technology, which was used primarily by Oracle applications, into a 100 percent, JSF-compliant component library. ADF Faces components also complement what is provided in the base components with over 100 new components geared toward Web developer productivity and power. These components include tree components, menus, date pickers, color pickers, and a multiselect shuttle. ADF Faces also comes with a performance-enhancing, partial-page rendering technology that allows only a portion of a page to reload, such as when scrolling through tabular data, as opposed to loading the entire page. ADF Faces also provides a handy dialog framework that can generate the necessary client-side JavaScript to open a popup window, accept input, and close itself. The newest feature of ADF Faces is its skinning technology, which allows developers to develop an entire look and feel for their Web application.
  • WebGalileo Faces – JScape has recently introduced its latest set of very powerful JSF components that include tabbed panels, menus, trees, tables, an HTML editor, and even a calculator.
  • ESRI – For the more specialized task of displaying graphical or map data, ESRI has introduced their own JSF component library.

These component libraries are just a small sample of a growing community. A relatively new JSF community Web site, JSFCentral.com, now tracks the progress of JSF technology in general and has a growing list of JSF component technology providers (see Resources). JSF component development is definitely heating up.

When comparing ASP controls and JSF components, we can conclude that because of the recent growth of new JSF component libraries, JSF technology is beginning to challenge ASP's dominance in the Web component-based development area. Now let's turn to a comparison of the platform's respective development environments.

ASP Visual Development
Microsoft's development environment, Visual Studio 2005, offers tightly integrated ASP.Net control interaction that improves the usability of the controls themselves. The aforementioned GridView component is one example. Having quickly mentioned the ability to easily pull up advanced property editors that are customized for each control, let's review some of the most impressive features of Visual Studio 2005:

  • Web page visual development – Visual Studio provides intuitive visual rendering of ASP controls in the visual editor. If you drop an ASP control onto the canvas, it renders as (as closely as possible) the run-time rendering, occasionally with dummy data to give the correct visual impression of the control's run-time rendering. As you select the control, you can either edit its properties using a generic property editor window or a nifty new Smart Tasks popup editor that is customized per control.
  • Databinding – You can use a Smart Tasks popup property editor to bind data and assign a datasource, simply by dragging a data object directly from the Servers Explorer to the canvas. This action provides a predatabound GridView and datasource control.
  • Other productivity features – Components such as property editors and page templates are handled through Smart Tasks editors, which are simple-to-use popup property editors that are customized for each ASP.Net control. It allows for customized configuration of complex controls. For example, you can easily define the properties of a GridView control such as the datasource; the columns of data to appear; and whether or not editing, sorting, or paging is possible. It is even possible to define the appearance of the control itself, such as alternating row colors and basic color themes.

J2EE obviously doesn't have a single, all-encompassing development environment; instead, the different vendors and open source providers have been providing a set of competing J2EE IDEs that for the most part offer similar development experiences. For this comparison, we'll examine the development experience of the JSF technology in a few different J2EE IDEs and contrast them with the development experience offered by Microsoft.

JSF Visual Development
Let's look at several leading Java development tools providers including Oracle, Sun Microsystems, and IBM to compare JSF/J2EE visual development to ASP visual development. As a whole, you'll find that the JSF-enabled J2EE IDEs compare very well with Microsoft's Visual Studio in that they all support to certain degrees the aforementioned key features such as Web page visual development, DataBinding, and numerous similar productivity features.

Let's first consider the Oracle JDeveloper 10.1.3 development tool, which is Oracle's latest version of its J2EE development environment that now offers JSF visual development support. This support is very comparable to Microsoft's Visual Studio's visual ASP development support. It is also similar to Visual Studio in that it is a multipurpose IDE, which means that in addition to supporting JSF development it also supports many other types of Java-related development, ranging from coding of simple Java classes to back-end business logic development with its integrated Enterprise JavaBeans (2.1 and now 3.0) along with Toplink development features.

With regard to Visual Studio's Web page visual development feature, JDeveloper 10.1.3 offers HTML, JSP, and even JSF-enabled JSP visual Web page development. JDeveloper's visual editor provides a run-time rendering of the JSF components while they are being edited. JDeveloper also compares well with Microsoft's strong integration with ASP controls by providing tight integration with the Oracle ADF Faces component library, with productive databinding and smart property editors.

In addition to being integrated with ADF Faces, it is also very easy to load external JSF component libraries into JDeveloper's environment. Apache MyFaces, WebGalileo Faces, and other Faces-component libraries easily integrate into the JDeveloper development environment. Databinding is also provided in JDeveloper by using its DataControl palette in which data items such as database tables are represented by server-side objects—entity beans or Toplink POJOs—that you can drag onto a page, generating a comparable JSF component on the fly and binding it to the server-side object. UI-first databinding is also possible where a JSF component can be dropped onto the page and then databound to a server-side data object.

For the other productive property features, JDeveloper provides re-entrant property editor wizards, which are invoked when a component is dropped onto a page or when a component's properties are accessed through a context menu from the visual editor. These re-entrant wizards offer the ability for advanced customization of the more complex components such as the ADF Faces table component that provides the similar features seen in Microsoft's GridView control: scrolling, paging, editing, and so on. JDeveloper even provides Web template support for HTML, JSP, and JSF.

Sun Microsystems' approach to J2EE development is provided in two products: open source NetBeans Java/J2EE IDE and, for JSF specific development, Java Studio Creator. For general J2EE development ranging from basic Java class development to enterprise JavaBeans, Sun's NetBeans development provides an all-encompassing environment.

For more traditional Java development NetBeans packs a powerful punch with a long list of coder-friendly features including refactoring, profiling, code folding, and so on. NetBeans also provides the ability to productively build the more server-oriented objects such as Enterprise JavaBeans, servlets, JSPs, and JSP tag libraries.

For developers strictly using JSF, Sun provides Java Studio Creator, which is a relatively unique product in that it focuses primarily on the corporate developer by providing a complete visual development experience for JSF. Similar to JDeveloper, Studio Creator also provides JSF Web page visual development where JSF components render themselves in the editor. Databinding is also supported in Studio Creator, where it's possible to drag a datasource object such as a table onto a JSF component like a drop-down menu that results in the component being databound to the data object (see Figure 3).

Again, similar to Oracle, Sun is also providing a next-generation set of JSF components, currently code named BraveHeart, which provides similar functionalities to the value-add component libraries such as ADF Faces and MyFaces.

Like Sun, IBM also offers more than one development environment for building different types of J2EE applications—WebSphere Application Developer and Rational Application Developer for WebSphere—although there is some overlap. For example, WebSphere Application Developer provides visual development support for JSF applications. It has a visual, JSF-enabled JSP editor as well as their own JSF component library. Productive property editors are available for editing complex components such as their datagrid (table) component. A similar databinding palette also does databinding easily.

More Tools
There are several other JSF development tools worth mentioning. These tools include Exadel's Studio Pro and M7's NitroX Java IDE. Exadel formerly had products called JSF Studio and Struts Studio, but the features for both were merged into Studio Pro. Studio Pro provides visual JSF development in addition to visual Struts development. Exadel's standout feature is probably its navigation diagrammer. Similar to Oracle JDeveloper and Sun's Studio Creator, it is possible to use Studio Pro to define the entire JSF navigation model, visually.

M7's NitroX development tool also provides powerful JSF development with similar features including Visual JSF page development, visual navigation view (navigation editing is still accomplished through a console or to the source directly.)

Both Studio Pro and NitroX are built on the Eclipse platform and clearly demonstrate that although they are less structured, the J2EE development tools environment is thriving with innovation because the core plumbing required for a Java IDE is offered for free to any company who wishes to turn it into a product.

Time will tell how profitable these smaller companies will remain, but they definitely provide a healthy dose of competition in the very Darwinian environment of J2EE. In short, JSF can compete with ASP. Although Microsoft provides a consistent development environment that covers the full development life cycle along with rich ASP.Net Web control libraries, J2EE also has a formidable arsenal on its side with its many JSF component libraries and new, productive JSF development environments that compete with each other as much as they do with Microsoft.

Now that we've see how J2EE can compete with .Net, especially in the newer areas of Web client development, let's examine how J2EE and .Net can integrate together as well.

How can J2EE and .Net integrate? Web services and SOA can bring these two technologies together. Web services form the glue that binds J2EE and .Net. Web services evolved out of some basic community-driven standards based on transmitting pure data in XML between different nodes on the Internet. What transpired was an explosion in a whole host of interconnectivity technologies on both the J2EE and .Net and J2EE platforms. Both technologies saw a common interest that led to the joint development and maturation of standards. These standards have resulted in the ability today to build and deploy services on the Internet (or any TCP/IP network) and have them communicate with each other, transcending the operating system or core technology from which they came.

On the J2EE side, using the J2EE Web technologies provided in the Servlet API made it possible to build publicly accessible Web services. They provide accessible method calls on any Java class. J2EE development tools such as JDeveloper also provide simple ways to generate the necessary code to consume the output from a Web service.

At the same time as the J2EE camp was getting its Web services act together, Microsoft was also working to provide a set of Web services-friendly features in its .Net architecture. What resulted was a set of easy development features where it is possible to expose any portion of .Net technology built in Visual Basic, C++, or C# and expose it to the Web through the same Web services protocols. Similar to J2EE, it is also very easy to consume Web services from external providers and plug their functionality into .Net applications (see Figure 4).

Services Solution
As Web services continue to standardize, a new standard built on top of the Web services standard protocols has emerged: SOA. SOA is a solution for architecting composite .Net and J2EE applications. With an SOA, developers no longer need to remain bound to any technology camp (J2EE, .Net, or even other legacy computer technologies). Instead, they could construct heterogeneous applications that are built up from a set of Web services as opposed to building a traditional client-server or single datasource application.

What has emerged with SOA is a new standard known as Business Process Execution Language (BPEL) or BPEL4WS. BPEL allows you to link different (Web) services together to achieve a business purpose in a single XML document (BPEL). For example, you can define a BPEL process to shop for the lowest rate for home loans from different providers on the Web and have only the most inexpensive loan provider's rate return as a final result. This process is possible in BPEL because coding logic into the BPEL process flow—such as comparing between the different rates from multiple providers and returning only the lowest rate—is feasible. BPEL can also account for multiple, long-running processes in parallel, which is known as an asynchronous process.

Since the final output of a BPEL process is also a Web service, it is possible to chain multiple BPEL process flows together to achieve more complicated business flows, which could involve numerous external services. With BPEL as a standard it has become possible to construct synchronous and asynchronous composite applications by linking together a series of Web services in an XML document. For BPEL to work it also requires a server that can interpret the XML BPEL document, which lists the different services and logic that connects them. In this regard, both J2EE and .Net have technology to build SOA applications.

Oracle's new BPEL design-and-deployment environment provides a complete solution for building composite, service-based applications. With the designer (which works in either JDeveloper or Eclipse), you can design visually a BPEL process flow and then deploy it to a BPEL-enabled server that handles the processes (see Figure 5).

On the .Net side, Microsoft provides an equivalent environment to build SOA applications with its BizTalk Server 2006. Don't let the "Server" part of the name fool you; the BizTalk environment also provides a rich BPEL design tool from which to productively string together different services into business process flows (see Figure 6).

We've examined how J2EE has made great progress on transforming itself from a server-oriented technology reserved only for computer scientists into a thriving, community-driven Web client powerhouse with JSF and the Java IDEs that compete to support them. We've also discussed how Microsoft has strengthened its offering in the company's traditional areas of expertise in client development with the new Visual Studio 2005 and ASP 2.0 components. In the end of these technology battles the true winner is logically the consumer of these technologies, for as we can see with the adoption of SOA and evermore parallel component-centric development paradigm, both technologies will be usable and will even be fully interoperable.

About the Author
Chris Schalk is a principal product manager and Java evangelist for application server and development tools at Oracle Corporation. Chris also maintains a blog on J2EE Web development. Contact Chris through his blog at: http://jroller.com/page/cschalk.