Home.NET Can J2EE and .NET Provide Cross-Platform I...
Can J2EE and .NET Provide Cross-Platform Interoperability?
Microsoft's .NET Framework and Sun's J2EE technologies are both very popular programming platforms. The two companies have historically been fiercely competitive with each other (though that has been less true over the past few months). Can platforms from these two companies interoperate? Dwight Peltzer addresses this question.
Contributed by Dwight Peltzer Rating: / 11 April 13, 2005
There are many innovative approaches to achieving interoperability between Microsoft's .NET Framework and J2EE technologies. Interop software solutions are broken down into two categories: software development tools, and plug and play tools. I will also discuss other interop technologies from both J2EE and .NET such as Microsoft’s Advanced Remoting technology and Sun Microsystems’s approach with SOAP to Web services.
This article chiefly serves as a brief overview of J2EE and .NET, their architecture and functionality, and then introduces a third party interoperability business solution from JNetDirect Software.
Much has been written about application integration and interoperability between legacy systems and new emerging technologies, and a variety of approaches towards merging the old with the new have been suggested. The rivalry between Java fans and .NET loyalists always causes endless debates around the issue of market dominance and access to platforms in various computing environments. Such discussions invariably lead to the following question: if both Java and Microsoft are committed to providing services for clients, wouldn’t both parties eventually want to share a common goal and conform to a set of standards that would benefit all developers, albeit Java or .NET?
Corporations have invested much time and money in developing legacy systems. It seems logical that eventually.NET will migrate towards the open source community and work towards a much needed consistent set of standards. It comes as no surprise that Sun supported an initiative called the Java Community Process (JCP) for the sole purpose of soliciting suggestions from major corporations to further the improvement of all Java platforms including J2ME, J2SE, and J2EE. This opened the doors to third party vendors by allowing them to contribute further to application and cross-platform interoperability and remote access to objects.
Before we delve into application integration, we will first consider platform-independent solutions from the two major players.
The Java2 Platform, Enterprise Edition (J2EE) v. 1.4, is Sun's approach to providing a component-based framework featuring reusable business components. The Java framework contains numerous abstract interfaces that facilitate the flexibility required to generate reusable code and yet support all features found in the Java programming language. This includes the ability to execute applications on any platform supporting the Java Virtual Machine (JVM). Other options include support for transactions, a wide variety of persistence frameworks, and security mechanisms.
Addressing the rapid increase in conducting business transactions on the Internet, Sun recognized the need for supporting XML-based Web services. In a manner consistent with their support for transactions on the Web, Sun frequently releases updates to their Web Service Development Pack (WSDP). The WSDP includes support for Java API for XML-based RPC-(JAX-RPC) 1.1, and SOAP with Attachments API for Java (SAAJ) 1.2. JAX-RPC 1.1, a part of J2EE 1.4, offers the foundation for all interoperability requirements required for supporting Web services.
The J2EE 1.4 specification designates Internet Inter-Orb Protocol (IIOP) as the primary communication protocol between components -- specifically, the RMI-IIOP (Remote Method Invocation Inter-Orb Protocol). Additionally, J2EE uses the Java Naming Directory Interface (JNDI) for access to remote objects.
Microsoft’s .NET platform is component based and sits on top of the Windows operating system. The .NET architecture is Web services-centric and paves the way for interoperability between technologies residing on the .NET platform. The ability to build applications in any programming language targeting the .NET framework is one of the most exciting innovations released by Microsoft in recent years. They designed the Framework to run on any platform, provided the Framework is installed on that system.
The .NET infrastructure presents a multi-tiered approach to distributed programming and uses SOAP as the primary technology for supporting Web services. The components consist of classes embedded within namespaces such as System.Object, System. Net, System.Windows.Forms, System.Web, and System.XML.
In a distributed environment, separating .NET’s presentation layer from the middle-tier business logic layer is a good practice. The third tier consists of low-level components for managing services such as database access, connection to legacy applications, and so forth. The .NET Framework uses HTTP as the communications protocol for messaging and exchanging documents via the Internet. This protocol allows any programming language, platform, or middleware to be an interactive participant in cross-platform interoperability. XML serves as the .NET architectural core component and provides the means with which to transmit XML-based SOAP messages.
The three core components of the Framework consist of the Common Language Runtime (CLR), the Common Type Specification (CTS), and the Common Language Specification (CLS). The CLR performs a wide variety of low-level system tasks, i.e., memory management, error handling, type checking, and security. The CTS defines common data types all programming languages targeting the Framework must conform to in order to receive multilanguage, interoperability support. Remember, a .NET type refers to a collection of classes, interfaces, delegates, and structures supported by the CLR. The CLS sets forth guidelines a .NET-aware compiler must follow before it can receive Framework support. Objects must expose to callers only features common to all .NET hosted languages.
What is interoperability? Interoperability, considered in the context of Web services, means all functional characteristics of a Web service must remain unchangeable across different operating systems, diverse applications, programming languages, and data business models. Web services, by definition, must be interoperable. Additionally, no service client must be interdependent upon other services.
Frequently, Java developers find it necessary to map their mission- critical data to databases such as SQL Server. Doing so usually requires an expensive proprietary solution that must be installed on both platforms. Fortunately, JSQL Mapper, a plug and play Java tool released by JNetDirect, does the job efficiently. It is easily configured and conforms to the industrywide XML standard. It allows you to design visually the relational mappings that will be executed by the Java Virtual Machine.
JSQL Mapper eliminates the necessity to create custom code. The best feature is that it accomplishes the task without modification to the existing database schema. Not only is this quite a timesaver, but it also eliminates errors and is wonderfully convenient.
Dwight Peltzer is also the author of J2EE and .NET Interoperability (McGraw-Hill/Osborne, ISBN 0-07- 223054-1). Pick it up at your nearest bookstore today!
(This article originally appeared, in a slightly different form, in the April 2004 issue of Plug in).