站内搜索: 请输入搜索关键词

当前页面: 开发资料首页J2EE 专题J2EE vs. Microsoft.NET(3)

J2EE vs. Microsoft.NET(3)

摘要: j2ee, .net
III. J2EE
--------------------------------------------------------------------------------


The Java 2 Platform, Enterprise Edition (J2EE) was designed to simplify complex problems with the development, deployment, and management of multi-tier enterprise solutions. J2EE is an industry standard, and is the result of a large industry initiative led by Sun Microsystems.

It's important for you to realize that J2EE is a standard, not a product. You cannot "download" J2EE. Rather you download a set of Adobe Acrobat PDF files which describe agreements between applications and the containers in which they run. So long as both sides obey the J2EE contracts, applications can be deployed in a variety of container environments.

The J2EE camp's goal is to give customers choice of vendor products and tools, and to encourage best-of-breed products to emerge through competition. The only way this would ever happen is if the industry as a whole were bought-into J2EE. To secure buy-in, Sun collaborated with other vendors of eBusiness platforms, such as BEA, IBM, and Oracle, in defining J2EE. Sun then initiated the Java Community Process (JCP) to solicit new ideas to improve J2EE over time. The reason Sun did this is because they had to do so to achieve success--the best way to secure buy-in to an idea is to involve others in defining that idea.


Java: The foundation for J2EE

The J2EE architecture is based on the Java programming language. What's exciting about Java is that it enables organizations to write their code once, and deploy that code onto any platform. The process is as follows:



Developers write source code in Java.
The Java code is compiled into bytecode, which is a cross-platform intermediary, halfway between source code and machine language.
When the code is ready to run, the Java Runtime Environment (JRE) interprets this bytecode and executes it at run-time.


J2EE is an application of Java. Your J2EE components are transformed into bytecode and executed by a JRE at runtime. Even the containers are typically written in Java.


J2EE and Web Services
J2EE has historically been an architecture for building server-side deployments in the Java programming language. It can be used to build traditional web sites, software components, or packaged applications. J2EE has recently been extended to include support for building XML-based web services as well. These web services can interoperate with other web services that may or may not have been written to the J2EE standard.

J2EE web services development model is shown in Figure 1.





Figure 1 Developing web services with J2EE


Briefly, Figure 1 is explained as follows:
J2EE application is hosted within a container, which provides qualities of service necessary for enterprise applications, such as transactions, security, and persistence services.

The business layer performs business processing and data logic. In large-scale J2EE applications, business logic is built using Enterprise JavaBeans (EJB) components. This layer performs business processing and data logic. It connects to databases using Java Database Connectivity (JDBC) or SQL/J, or existing systems using the Java Connector Architecture (JCA). It can also connect to business partners using web services technologies (SOAP, UDDI, WSDL, ebXML) through the Java APIs for XML (the JAX APIs).

Business partners can connect with J2EE applications through web services technologies (SOAP, UDDI, WSDL, ebXML). A servlet, which is a request/response oriented Java object, can accept web service requests from business partners. The servlet uses the JAX APIs to perform web services operations. Shared context services will be standardized in the future through shared context standards that will be included with J2EE.

Traditional 'thick' clients such as applets or applications connect directly to the EJB layer through the Internet Inter-ORB Protocol (IIOP) rather than web services, since generally the thick clients are written by the same organization that authored J2EE application, and therefore there is no need for XML-based web service collaboration.

Web browsers and wireless devices connect to JavaServer Pages (JSPs) which render user interfaces in HTML, XHTML, or WML.


Reference Implementation
In addition to the specifications, Sun also ships a reference implementation of J2EE. Developers write applications to this to ensure portability of their components. This implementation should not be used for production, but rather just for testing purposes.


Additional Services
All vendors that offer J2EE platforms provide additional features not found in the standard. Some of them impact portability, such as extended EAI functionality, E-Commerce components, or advanced B2B integration. Other features, such as load-balancing, transparent fail-over, and caching, do not affect portability of application code, because they are implicit services which are provided behind-the-scenes by the container.




↑返回目录
前一篇: J2EE vs. Microsoft.NET(1)
后一篇: J2EE技术简单介绍