J2EE comprehensive profile

xiaoxiao2021-03-06  64

J2EE comprehensive profile

Liu Zhan (

Jeru@163.net)

Bachelor of Information and Computational Science, Wuhan University

July 2001

This paper has been more comprehensive in J2EE from five aspects. Start from J2EE concept, to its advantage, to J2

EE Typical four-layer model, and its framework structure, and finally a profile for J2EE thirteen core technology. Herein

The door class has a more detailed introduction to the services, components, hierarchies, containers and APIs in J2EE. I believe this

Wen, readers will have a clearer understanding of J2EE.

I. Concept of J2EE

At present, the Java 2 platform has three versions, which are applicable to small devices and smart cards, Java 2 platform micro version (

Java 2 Platform Micro Edition, J2ME), Java 2 Platform Standard Edition for Desktop System (JAV

A 2 Platform Standard Edition, J2SE, suitable for creating server applications and services Java

2 Platform Enterprise Edition (Java 2 Platform Enterprise Edition, J2EE).

J2EE is a complex problem with the development, deployment, and management related complex issues that use Java 2 platform to simplify business solutions.

Architecture. The basis of J2EE technology is the standard version of the core Java platform or Java 2 platform. J2EE is not only consolidated.

Many advantages in the standard version, such as "writing once, run everywhere", easy access to the JDBC API

, CORBA technology and security models that can protect data in Internet applications, etc., but also provide EJ

B (Enterprise Javabeans), Java Servlets API, JSP (Java Server Pages) and XM

L Technical support. The ultimate goal is to become a significant shorteness of enterprise developers

Architecture.

The J2EE architecture provides intermediate-level integrated frameworks to meet no need for too much cost and require high availability, high reliability

And the needs of scalability applications. By providing a unified development platform, J2EE reduces the cost of developing multi-layer applications.

With and complexity, provide strong support for existing applications, fully support Enterprise Javabea

NS, good guidard support packaging and deploying applications, add directory support, enhance security mechanism, and improve performance

.

II. J2EE's advantage

J2EE provides a good mechanism for building a commercial system with scalability, flexibility, and easy maintenance:

Retain existing IT assets: Since companies must adapt to new business needs, using existing corporate information systems

Investment, rather than re-establishing a total plan. In this way, one is gradually (rather than radical,

The server-side platform mechanism established on the existing system is based on the company's needs. J2EE architecture

You can make full use of the original investment, such as the BEA Tuxedo, IBM CICS, IBM Encina, IBM CICS, IBM ENCINA

, Inprise Visibroker, and Netscape Application Server. This is possible because

J2EE has a wide range of industry support and some important 'enterprise calculation' sector suppliers' participation. Every supplier

For existing customers, there is a upgrade pathway that does not have to discard existing investments and enters the portable J2EE. Due to

The product of the J2EE platform can almost operate on any operating system and hardware configuration, existing operating systems and hardware

Can be reserved.

Efficient development: J2EE allows companies to hand over some general, cumbersome server tasks to middleware suppliers

to make. This developers can concentrate on how to create business logic, reduce development time accordingly. Advanced intermediate suppliers offer the following complex middleware services:

Status Management Services - Let developers write less code, do not care about how to manage, this can be faster

Complete program development.

Sustained Services - Let developers can write applications without coding data access logic, can generate more

Lightweight, unrelated to the database, which is easier to develop and maintain.

Distributed Shared Data Objects Cache Services - Let developers prepare high-performance systems, greatly improve overall deployment

Portability.

Support heterogeneous environments: J2EE can develop portable procedures deployed in heterogeneous environments. J2EE-based application is not

Rely on any particular operating system, middleware, hardware. Therefore, the design-based J2EE-based procedure is only developed once.

You can deploy a variety of platforms. This is critical in a typical heterogeneous enterprise computing environment. J2EE standard is also allowed

Customer ordering the ready-made components of J2EE-compatible third-party, deploying them into the heterogeneous environment, saving by themselves

The cost required for the entire program is developed.

Scalability: Enterprises must choose a server-side platform, which should provide excellent scalability to full

A large number of new customers who have business operations in their system. Applications based on J2EE platforms can be deployed

Various operating systems. For example, it can be deployed to high-end UNIX and mainframe system, which can support 64 to 25 single machine

6 processors. (This is the supplier of the NT server) J2EE field provides a more extensive load.

Balance strategy. Can eliminate bottlenecks in the system to allow multiple servers integrated deployment. This deployment can reach thousands of processors

Realize the highly scalable system to meet the needs of future business applications.

Stable availability: A server-side platform must be able to operate all day to meet the needs of company customers, partners

. Because Internet is global, there is everywhere, even if you plan to stop at night, it may cause serious damage.

. If it is unexpected, there will be catastrophic consequences. J2EE deployed into a reliable operating environment, they support long-term

Availability. Some J2EE deployed in a Windows environment, customers can also choose robust performance, such as Sun

Solaris, IBM OS / 390. The most robust operating system can reach 99.999% availability or only 5 minutes a year.

Machine time. This is an ideal choice for real-time business systems.

Three. J2EE's four-layer model

J2EE uses multi-layered distributed application models, application logic is divided into components, and each application component is based on them.

The layers are located on different machines. In fact, the original intention of Sun Design J2EE is to solve two-story mode (CL

IENT / Server's drawbacks, in traditional mode, the client acts as too much role and looks bloated, in this model

In the first deployment, it is relatively easy, but it is difficult to upgrade or improve, and the stretchability is not ideal, and often

Based on some proprietary protocol - is usually a certain database protocol. It makes reuse business logic and interface logic very

difficult. Now J2EE's multi-layer enterprise application model cuts different levels in the two-layer model into many layers. One

Multi-layered applications provide a separate layer for each of the services, the following is a typical four-layer structure of J2EE:

Customer layer components running on the client machine

WEB layer components running on the J2EE server

Business logic layer components running on the J2EE server

Enterprise Information System (Enterprise Information System) Software running on the EIS server

J2EE application components

The J2EE application is composed of components. J2ee components are software units with independent features, they pass related classes.

And file assembled into J2EE applications and interact with other components. The following J2EE components are defined in the J2EE manual.

:

Application client programs and applets are customer layer components.

Java Servlet and JavaServer Pages (JSP) are web layer components.

Enterprise JavaBeans (EJB) is a business layer component. Customer layer component

The J2EE application can be a web-based, or may be based on a traditional manner.

The web layer component J2EE Web layer component can be a JSP page or servlets. Follow the J2EE specification, static HTML page

And Applets is not an Web layer component.

As the client layer shown below, the web layer may contain some JavaBean objects to handle user input, and put

Enter the ENTERPRISE BEAN that is sent to the business layer to process.

Business layer components

The logic of business layer code is used to meet the needs of special business sectors such as banks, retail, and finance, by running on the business layer.

Enterprise bean is handled. The following figure shows how an Enterprise bean is from the client program.

Receive data, process (if necessary), and send it to the EIS layer, this process can also be reversed

Row.

There are three enterprise-class beans: session beans, entities (Entity) Beans, and Message Drivers (MES

Sage-Driven) Beans. Session bean means a temporary interaction with the client program. After the client program is executed

The session bean and related data will disappear. On the contrary, the entity bean represents a permanent record in the table of the database.

When the client program is aborted or when the server is turned off, there will be potential service to ensure that the data of the entity bean is saved.

. Message Driver BEAN combines the characteristics of the message listener of session bean and JMS, allowing a business layer component to be different

Step Receive JMS messages.

Enterprise information system layer

Enterprise Information System Layer Processing Enterprise Information System Software includes enterprise infrastructure systems such as enterprise resource programs (ERP)

, Large machine transaction processing, database system, and other legacy information systems. For example, J2EE application components may be

Database connection requires access to enterprise information systems

Four. J2EE's structure

This component-based, a platform-independent J2EE structure makes the J2EE program is very simple because

Logic is encapsulated into a reused component, and the J2EE server provides a background in the form of containers.

Service. Because you don't have to develop this service yourself, you can concentrate on solving your business problems.

Containers and services

The container settings customized the J2EE server, including security, transaction management, JNDI (Java Nami)

NG and Directory Interface Addressing, Remote Connection, etc. The following is the most important service:

J2EE Security (Security) model allows you to configure web components or Enterprise Beans, which is only authorized

Users can access system resources. Each customer belongs to a special role, and each role only allows activation of specific

Methods. You should declare roles and activation methods in the Arrangement description of Enterprise Beans. Due to this sound

Method, you don't have to write rules that strengthen security.

J2EE Transaction Management Model Let you specify all methods in a transaction

Relationship, all methods in such a transaction are regarded as a single unit. When the client activates an Enterprise

The method in the Se BEAN, the container involves a management transaction. Due to container management transactions, do not in Enterprise Bean

Must encode the boundary of the transaction. The code that requires controlling distributed transactions will be very complicated. You only need to describe

Declare the transaction attribute of Enterprise Bean without writing and debugging complex code. Container will read this article

Parts and handle this Enterprise Bean transaction.

JNDI Addressing Service provides a unified interface to multiple names and directory services in the enterprise.

The sample application program component can access the name and directory service.

J2EE Remote Client Connectivity Model Management Client and the low-level interaction between the Enterprise Bean. When an Enterprise Bean is created, a client can call it method like it and the customer.

The end is the same as the same virtual machine.

Life Cycle Management Model Management Enterprise Bean creation and removal, one

Enterprise Beans will have several states in its survival cycle. Container creates Enterprise Bean, and

You can move him in an instance pool with the active state, and finally remove it from the container. Even if you can call Enterprise

BEAN's CREATE and REMOVE methods, the container will also perform these tasks in the background.

Database Connection Pooling model is a valuable resource. Get databases

The connection is a time consuming work, and the number of connections is very limited. The container is alleviated by managing the connection pool.

Enterprise Beans can quickly get connected from the pool. The connection is used for other beans in the bean release.

Container type

The J2EE application component can be installed to the following containers:

EJB container manages the execution of enterprise-level beans in the J2EE application. Enterprise bean and their capacity

The operator runs on the J2EE server.

Web container manages all JSP pages and servlet components in the J2EE application. Web components and their capacity

The operator runs on the J2EE server.

Application Client Contract Management All J2EE applications are executed in the application client components. Application

The household and their containers are running on the J2EE server.

The AppleT container is a combination of web browsers and Java plugins running on the client machine.

5. J2EE's core API and components

The J2EE platform consists of a single service (SERVICES), the application interface (APIS), and protocol, which is based on the development base.

The multi-layer application of the Web provides functional support, and the following is a simple description of 13 technical specifications in J2EE (limited to

Convenient description here can only be described here):

JAVA DATABASE CONNECTIVITY:

JDBC API provides a unified way for accessing different databases, like ODBC, JDBC blocks developers

Some detail issues, in addition, JDCB access to the database has a platform-independent.

JAVA NAME AND DIRECTORY INTERFACE:

JNDI API is used to perform names and directory services. It provides a consistent model to access and operate enterprise resources

Such as DNS and LDAP, local file systems, or objects in the application server.

EJB (Enterprise Javabean):

One of the reasons why J2EE technology wins some of the extensive attention is EJB. They provide a framework to develop and implement

Separate business logic, which significantly simplifies the development of enterprise-class applications with scalability and highly complex

. The EJB specification defines how EJB components interact with their containers. The container is responsible for providing public

Services, such as directory services, transaction management, security, resource buffer pools, and fault tolerance. But here is worth noting

Yes, EJB is not the only way to implement J2EE. It is because of the opening of J2EE, making some manufacturers can

And the EJB parallel way to achieve the same purpose.

RMI (RemoteMETHOD Invoke):

As indicated by his name, the RMI protocol calls the remote object method. It uses a serialization mode in the client

And server-side delivery data. RMI is a more underlying protocol used by EJB.

Java IDL / CORBA:

With the support of Java IDL, developers can integrate Java and Corba. They can create java pairs

Icon and make it expanded in Corba ORB, or they can also create a Java class and a customer who expands with other ORBs. The latter approach provides another way, through which Java can be used to use your new

Application and old system integration.

JSP (Java Server Pages):

The JSP page is composed of HTML code and embedded Java code. The server is requested after the page is requested by the client.

These Java code processes, and then return the generated HTML page to the client's browser.

Java servlet:

Servlet is a small Java program that extends the functionality of the web server. As a server-side application

When the request is requested, this is similar to the CGI Perl script. Most of the features provided by servlets are similar to JSP.

However, it is different from the implementation. JSP is usually embedded in a small number of Java code in most HTML code, while servlet

S is all written by Java and generate HTML.

Extensible Markup Language:

XML is a language that can be used to define other tag language. It is used to share data in different business processes.

The development of XML and Java are independent of each other, but it is the same objective as Java is platform independence. by

A combination of Java and XML, you can get a perfect platform-independent solution.

JMS (Java Message Service):

MS is an application interface (API) for communication with a message-oriented middleware. It supports the domain of point-to-point,

Support publish / subscribe (publish / subscribe) domain, and provide support for the following types: approved

Message delivery, transaction messaging, consistent messaging, and subscriber support for persistence. JMS also provides another

One way to integrate your application with the old background system.

JTA (Java Transaction Architecture):

JTA defines a standard API, which can be accessed by various transaction surveillance.

JTS (Java Transaction Service):

JTS is the basic implementation of CORBA OTS transaction monitoring. JTS specifies the implementation of the transaction manager. This transaction management

The device is in the high-level support Java Transaction API (JTA) specification, and implements omg OTS Specif at a lower layer.

The Java image of Ication. JTS Transaction Manager is an application server, resource manager, independent application, and communication

The resource manager provides a transaction service.

JavaMail:

JavaMail is an API for accessing a mail server, which provides an abstract class of a mail server. Not only support S

The MTP server also supports the IMAP server.

JTA (JavaBeans Activation Framework):

JavaMail uses JAF to handle MIME encoded mail attachments. MIME's byte stream can be converted into a Java object, or

Convert from Java objects. Most applications can use JAF directly.

Reference:

"Develop N-Tier Application Using J2EE" - Steven Gould

"The Business Benefits of EJB AND J2EE TECHNOLOGIES over COM And Windows D

NA "

"THE J2EE TUTORAL" Chapter Overview - Monica Pawlan

The pictures used herein are modified by the English picture in "The J2EE Tutorial".

About author

Bachelor of Information and Computing Science, Wuhan University, familiar with Java language and J2EE thinking, more than JAVA in China

Forum moderator, is now committed to the development of ECRM suite on the J2EE platform. You can pass

Jeru@163.net

system!

转载请注明原文地址:https://www.9cbs.com/read-83542.html

New Post(0)