Advantages and disadvantages of J2EE and. Net platforms

Source: Internet
Author: User
ArticleDirectory
    •  

Release date: Source: Saidi Author:

I. Technical Overview

In terms of performance, J2EE is a set of specifications, and. NET is more like a set of products. However, they are designed to provide distributed and highly reliable solutions for enterprise applications. They have many similarities in architecture. The following table is a simple comparison:

J2EE. net

Communication Protocol Remote Method Invocation over Internet interorb protocol (RMI/IIOP), XML

Programming LanguageJava C #, VB. NET, COBOL

Runtime Environment Java Virtual Machine (JVM) Common Language Runtime (CLR)

Fat client Java swing Windows Forms

Directory Service Java Naming and Directory Interface (JNDI) Active Directory Services interface (ADSI)

Data Access Java database connection (JDBC), Java connectors ADO. net

Asynchronous Message Processing Java Message Service (JMS) Microsoft Message Queue

Presentation Layer Technology Servlets, Java Server Page (JSP) ASP. NET

Middle layer component model EJB, JavaBean COM +, com

Secure access to jaas com + Security

Call Context

Transaction Processing Java Transaction Server (JTs) Microsoft Distributed Transaction Coordinator (MS-DTC)

Development Tool webgain visual caf é

Borland JBuilder

IBM visualage

(Provided by a third party and not defined by the specification itself) Visual Studio. NET

Composition of the J2EE Platform

EJB-J2EE middle layer to complete business logic;

JAAS-APIs for processing authentication and authorization by J2EE;

Java ors Ors-J2EE APIs for connecting to heterogeneous data sources are transparent to the upper layer;

JSP, Java Servlets-J2EE presentation layer technology, used to generate a user interface;

Java Virtual Machine-Java Runtime Environment;

JDBC-J2EE database access;

Asynchronous Message Queue of JMS-J2EE;

JNDI-J2EE name query API, independent of the directory server;

JTs-APIs used by J2EE to process transactions;

Communication API for Distributed Objects of RMI/IIOP-J2EE, which provides the ability to interact with CORBA.

. NET platform Composition

The basis for running. NET Framework-. NET applications;

Il (intermediary language)-all. NET languages are first compiled into this intermediate language and then run in CLR;

Soap-industrial standard for service access;

DCOM-Inter-component communication protocol;

MS-DTC-used to handle distributed transactions on the. NET platform using a two-phase commit protocol;

The runtime environment of the CLR-. NET application;

COM +-. Net intermediate layer model for building business logic;

Ado. Net-. Net APIs for data access.

In addition. NET platform also includes other products such as application center server, BizTalk Server, nlbs (network load balancing service), Commerce Server, Enterprise Servers, his (Host Integration Server ), ISAS (Internet Security and Acceleration Server) is used to provide services such as firewalls, secure access, B2B transactions, and load balancing. the J2EE specification does not define these services, but similar requirements can be met by choosing a third-party product.

Ii. Technical Comparison

1. One vs multiple

One language vs multiple languages, one platform vs multiple platforms. This seems to be the most popular topic and the focus of all problems.

the mainstream development languages Java and C # On the two platforms have striking similarities in Architecture: Virtual Machine technology, Sandbox-based security models, hierarchical namespaces, and garbage collection. So from the first glance, C # is just a Java clone. However, Microsoft does not think so. Microsoft's explanation is: "It integrates the essence of C ++, Java, modula 2, C, smalltalk, and other languages, their core ideas, such as deep object-orientation and Object-simplification, are all referenced one by one." On the one hand, most of the keywords of C # Come from C ++, making it different from Java in writing. On the other hand, the strict type conversion and other concepts of C # Come from Java (of course, the definition of its original type is more strict, and Microsoft claims that it has not affected the efficiency .), this makes it possible to clone the content. but it is Java, and some of its features are also quite related to Smalltalk. therefore, the evaluation of a development language is not only based on its external forms of expression, but also its actual effectiveness. as a new language, C # adds XML-based markup and can be used by the compiler to generate documents directly. Another feature of C #: one-stop-shopping Software) the self-describing encoding method is emphasized, that is, the header file, IDL (Interface Definition Language), guid and other complex interfaces do not need to be referenced. that is, C #, VB.. NET and other Code segments can be added to any other language. this is undoubtedly a fly in the mixed programming mode of multiple languages However, the maintainability is self-evident.

Microsoft.. NET platform provides. net, COBOL, and other development languages, C # is new, and every other language is transformed based on the original. this is what Microsoft has been so painstaking and cannot be used to these languages.ProgramThe staff laid a convenient path. however, the language transformation is not so much a cosmetic surgery as a big open-up operation. first, concepts have changed. Basic, COBOL, and other languages lack the connotation of object-oriented, but now they have become object-oriented languages, this is not a simple question that requires traditional programmers to be familiar with some additional keywords. object-oriented software analysis, design, development, and testing are completely different from qualitative changes based on traditional procedural languages. Therefore, the transformation of this process is also a painful and long process for traditional programmers. in the face of traditional programmers, Microsoft seems to have provided a variety of solutions, but for actual problems, it is not enough. therefore, a simple method is to directly use C #. for independent software developers, the conversion cost cannot be ignored. second, when using multiple languages in a software project, developers must have multiple language experts and independent development teams that are difficult to support each other, this also increases the cost of software maintenance by a non-linear curve. diversity is a double-edged sword, which must be carefully considered during implementation.

Cross-platform is the biggest selling point of J2EE, and so far it has withstood Microsoft's fence. when the developer completes the software that complies with J2EE specifications, the customer can choose different application servers based on their preferences and strength. from open source-based free software to high-end business suite to meet B2B needs to build their own platform. however, due to the imperfect J2EE specifications, various J2EE server providers have to add some additional features to provide them with their fully understood functions. this makes the application software that uses these special features bound to a specific application server. with the development of J2EE specifications, this difference will gradually decrease.

Microsoft's cross-platform solution is Web Services, which solves the connectivity problem between different applications on heterogeneous platforms. from a technical point of view, it has nothing new except XML as the media. however, its significance is that it was launched by a heavyweight player such as Microsoft, and its prospects cannot be underestimated. the process of constructing and using web services is relatively simple:

The service provider constructs the service in the language he chooses;

The service provider uses the Web Services Description Language to define the service;

The service provider registers the service in UDDI (Universal Description, discovery, and integration;

Users' applications search for registered services from UDDI;

The user's application uses soap (The Simple Object Access Protocol) to call the service. (soap uses http to transmit parameters in XML format)

As we have discussed, Web Services solves the service connectivity problem on a heterogeneous platform. However, what is more urgent in reality is how to build a scalable architecture on a heterogeneous platform, enterprise applications with high reliability, high availability, fault redundancy, and error recovery capabilities. this is missing. In terms of structure ,. NET platform is far from complete.

2. Intermediate Layer

The component-based software development technology can achieve software reuse at a higher level, accelerating the process of enterprise software development. in the J2EE architecture, JavaBean and EJB (Enterprise JavaBeans) are used to complete the transaction logic. EJB and JavaBean have similar models, but they are used to create distributed enterprise applications. it defines the model of server components and has the following features:

Survival model;

Access Model;

Security Model;

Transaction Processing Model;

Session processing model;

Data encapsulation model;

Deployment model

Based on these models, simple coding can complete complex functions.

On Microsoft's. NET platform, the old COM and COM + component models are replaced by the new component models. Added functions such as sandbox-based security model and garbage collection. it also implements multi-interface inheritance, extended metadata, and new proxy models. the old COM and COM + components can also be mapped to the new runtime environment.

To sum up, the two architectures have their own merits in the design of the component-based middle layer. They are capable of creating Distributed, complex, efficient, and highly reliable applications.

3. Presentation Layer

Both architectures support both fat clients and thin clients. c/S mode and B/S mode. for the C/S mode, J2EE provides a Java swing alternative to Java AWT, and can also be used as a visual component to construct a system. For the presentation layer of the B/S structure, J2EE uses servlet, JSP (Java Server Page), hmtl, WML, XML and other tools for implementation.

Microsoft's fat client technology is replaced by Windows Forms. they play the same role. In the structure, Windows Forms are inserted.. Net runtime framework and component model. in the thin customer model, Asp. net replaces the old ASP, hmtl, WML, and XML as the presentation layer. In ASP. net, C #, VB.. NET and other language code snippets can be freely referenced. ASP. the net page is first converted to the intermediary language, then compiled by the just-in-time il compiler, and finally run in the runtime environment of the public language, and ASP. NET provides page buffering, so its running speed is much faster than ASP.

In general, the presentation layer technology used by the two architectures is very similar. Although they have their own advantages in detail, the overall function is between the two.

4. Data Access

J2EE and. Net Support data access in different forms. JDBC and ADO have nothing to do with the connected database, and operate data through connections, command statements, and result sets. therefore, the API belongs to the intermediate level. A higher level of data encapsulation and data management is achieved through the entity EJB. the entity EJB Based on container management makes development faster and management more convenient. in fact, because of the synchronization mechanism of the load () and store () Methods of the entity EJB, the database bottleneck caused by concurrency will be greatly mitigated. you can also use third-party data access tools that do not comply with J2EE specifications, such as the toplink of webgain.

Microsoft. NET data access tool is based on the XML-based ADO. net replaces the com-based ADO. any data source with XML output can be used as ADO. NET data source. the corresponding result set is upgraded to datasets, and the command statement is upgraded to datasetcommands ). from the perspective of form, Microsoft's ADO. net updates and fashion, XML-based features enable it to process extremely rich data sources, and because of its architecture above the HTTP protocol, it is easy to penetrate the firewall, making communication more convenient. however, because of the tag-based characteristics of XML, it is obvious that it limits the use of applications with large data volumes and network bottlenecks. the J2EE data access rules are relatively thin, but they are simpler and more effective at the same time. in addition, through an effective hierarchical design of applications, access to databases and XML-based data sources can also be seamlessly integrated.

Iii. Overall Evaluation

When Microsoft does not have products that are relatively resistant to the Java platform, Microsoft is happy to make a loud publicity: "write once, debug everywhere ". Its opponent is more willing to comment on it like this: "Microsoft also liked Java at the beginning. The way they liked it was to let it die, and of course they hated it, they even hate every word starting with J. "But now, the form is different. Microsoft is proud to have. net. They can compare J2EE and. Net in their preferred ways. The most lively is the third-party pair presented by Microsoft. net pet shop and J2EE pet store are compared comprehensively. interested readers can go to the msdn, www.onjava.com, IBM developers and other websites to see related comments.

J2EE. net

Ease of use *****

Scalability *****

Multi-platform support *****

Multi-language support *****

Reliability ******

Performance ******

Manageability ******

Reusability ******

Load Balancing ******

Open Standard ******

For enterprises, integration, scalability, and security of many internal systems are more important topics. These are the advantages of J2EE and Microsoft's shortcomings. In terms of efficiency, the J2EE camp advocates increasing hardware efficiency to compensate for software deficiencies. Open Standards, powerful functions, and easy porting are all selling points of J2EE. However, it is strange that IBM WebSphere and BEA WebLogic account for half of the J2EE market, while Sun, the rule maker, is doing this.

Microsoft does provide all-round products from office software, development tools, to backend server databases. However, the users of the unified platform may sacrifice the benefits of cross-platform platforms, and may be locked in the vast ocean of Microsoft licenses. simpler, faster, and more efficient is Microsoft's goal. With the development of the times, we may see more perfect technical solutions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.