Java* and .NET* Both Bring Something to the Party

by Paul Steinberg, Sharat Agarwal, and George Vorobiov


Introduction

Each of the dominant Managed Runtime Environments has distinct advantages and a bright future; Intel is working with ISVs to provide next-generation support for both.

The .NET and Java platforms both provide support for enterprise deployment of distributed business systems, yet significant differences between the two platforms are worth examining.

The Java platform is based on industry-defined standards. It consists of a programming language, a voluminous set of APIs and tools, and a runtime environment, the Java Virtual Machine (JVM).

The JVM executes a Managed Runtime Environment (MRTE) and supports key features of the MRTE: memory management, exception handling, thread scheduling, and security. The JVM is portable to numerous operating systems and hardware platforms, but it supports only the Java programming language.

The .NET Platform consists of the .NET Framework class library, the Common Language Specification (CLS)*, the Visual Studio .NET* IDE, .NET programming languages, and a managed runtime environment: the Common Language Runtime (CLR).

The CLR supports multiple programming languages, each of which provides its own front-end compiler to generate intermediate language (IL) code, which is organized into assemblies. More than 20 programming languages are supported by .NET, including C, C++, VB.NET*, J#* and the C#* programming language, which was specifically developed for the .NET platform. New languages are added to the .NET roster constantly.

C# is the programming language of choice for the .NET platform. It boosts programmer productivity by introducing a set of programming primitives to automate common programming tasks (events, delegates, properties, attributes, iterators, and overload operators). .NET also provides easy integration with unmanaged WinAPI* code and COM+* components and services.


Java and .NET Support Enterprise Deployment of Distributed Systems

J2EE* is the version of the Java platform specifically for enterprise computing. A number of features enable development of large-scale, high-availability applications, including support for distributed transactions, role-based security, object pooling, data-connection management, and automated SQL Server* data manipulation.



Figure 1: The J2EE e-commerce application stack.

Microsoft* .NET has no separate platform edition for enterprise-class computing. Instead, it relies on the COM+ infrastructure (called the Enterprise Services package in .NET) to carry out some of the same functions as the J2EE container.



Figure 2: The .NET e-commerce application stack

Both J2EE and Microsoft* .NET provide good support for creating and deploying fron t-end Web applications. The key to success is to separate HTML scripting from the actual code executed by the MRTE that validates input parameters, invokes business logic components, and generates parts of the resulting page dynamically.

Both platforms have the ability to pre-compile an entire Web application into managed code before execution, which improves performance, compared to interpreted-script execution.

ASP .NET has better support for code/HTML-script separation than Java, using code-behind classes generated automatically by Visual Studio .NET. Java provides Java Server Pages, servlets, and Custom Tag Libraries to achieve the same effect.


.NET Provides Somewhat More Robust Web Services Support

Developers can specify either a binary or an XML-based protocol for invoking remote business-logic components with either J2EE or .NET. Microsoft .NET has fully integrated support for Web services standards, however, whereas not all J2EE platforms completely support XML-based communications.

An article by Intel Chief Strategist Chris S. Thomas discusses why robust support for Web services is likely to play a significant role in the future of application development.

.NET makes XML-based distributed computing easier by automating Web services development and deployment and by implementing SOAP and UDDI standards. Web services are functionally very similar to Microsoft ASP .NET pages, in that they are deployed via an IIS Web server and have access to the same set of APIs as regular ASP pages.

Only J2EE provides support for CORBA-based distributed computing.

When the call is made to a remote component in either environment, the platform instantiates it in the remote MRTE instance and manages its lifetime based on component type.

In a J2EE Session Bean, the client notifies the application server when it has finished using the EJB (Enterprise Java Bean), whereas .NET has a lease-based policy for remote objects. In .NET, the lease can expire, and the method call will throw an exception, requiring the client to reacquire reference to the object.

Microsoft ADO .NET provides a set of APIs to access data in SQL Server, though none of them implements the same kind of automatically synchronized components (managed by the platform itself) as the EntityBean API in J2EE. Instead, a DataSet API treats data independently of where it came from (with data-manipulation adapters for different types of data sources like DB or XML documents).

.NET class methods are always compiled to native code before execution, either on the fly by JIT compilers or beforehand by a pre-JIT compiler.


Conclusion

Intel is working to understand and to define the relationship between architecture and MRTEs. The next article in this series, "Intel® Technology Provides the Basis for Next-Generation MRTEs", shows how Intel is working with ISVs like Microsoft and BEA* to improve the per formance and scalability of support for MRTE-based solutions on its platforms.


Additional Resources

Intel, the world's largest chipmaker, also provides an array of value-added products and information to software developers:

  • Intel® Software Partner Home provides software vendors with Intel's latest technologies, helping member companies to improve product lines and grow market share.
  • Intel® Developer Zone offers free articles and training to help software developers maximize code performance and minimize time and effort.
  • Intel Software Development Products include Compilers, Performance Analyzers, Performance Libraries and Threading Tools.
  • IT@Intel, through a series of white papers, case studies, and other materials, describes the lessons it has learned in identifying, evaluating, and deploying new technologies.
  • The Intel® Academic Community Educational Exchange provides a one-stop shop at Intel for training developers on leading-edge software-development technologies. Training consists of online and instructor-led courses covering all Intel® architectures, platforms, tools, and technologies.

Catégories:
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.