Introduction to the four-layer structure of Java EE

Source: Internet
Author: User

1. Introduction

Java EE uses a multi-tier distributed application model, the application logic is divided into components by function, each application component is distributed on different machines according to their layer. In fact, Sun design Java EE is to solve the problem of two-tier model (Client/server), in the traditional mode, the client has too much role to appear bloated, in this mode, the first deployment is easier, but difficult to upgrade or improve, extensibility is not ideal. It makes it very difficult to reuse business logic and interface logic. Now Java EE's multi-layer enterprise application model divides the different layers in the two-layered model into many tiers. A multi-tier application can provide a separate layer for each service, the following is a typical four-layer structure of Java EE:

(1) Client tier client layer, running on the clients machine. The client layer generally supports the HTTP protocol, also known as the Client Agent.
(2) Web tier Web application layer, run on the Java server. In Java EE, this layer is run by a Web container, which includes a Web Part such as JSP, Servlet, and so on.
(3) EJB Tier Enterprise component layer, running on the Java EE server. The enterprise component layer is run by the EJB container and supports services and technologies such as EJB, JMS, JTA, and so on.
(4) Eis tier Enterprise Information System (Enterprise information System) layer, running on an EIS server. Enterprise Information System includes the traditional information system such as finance, CRM and so on, which is characterized by the support of database system.



2. Java Application Component

The entire application of Java EE is made up of components. The Java EE component is a software unit with independent functions. Each layer of the four-layer model of Java EE is also encapsulated in a component that is similar in functionality. The main contents of these four-tier components are briefly described below, each of which includes the corresponding components, which are assembled into a Java EE application through related classes and files and interact with other components.

(1) Client component
Java EE applications can be either web-based or traditional. Typically static HTML Web pages, application client programs, applets, or other applications.
(2) Java EE Web layer components mainly include JSP pages or Servlets. In addition, the Web layer may contain some JavaBean objects to handle user input and send the input to the enterprise bean running on the business layer for processing. In fact, some of the simple business logic does not involve the database, can reduce the burden on the client.
(3) The business layer as the name implies is used to deal with the business, he is mainly run on the business layer Enterprise bean processing. There are three enterprise-class beans: Session beans, Entity (entity) beans, and message driven (Message-driven) beans. The session bean represents a temporary interaction with the client program. When the client program finishes executing, the session bean and related data disappear. Instead, the entity bean represents a row of persistent records in the database's table. When the client program aborts or the server shuts down, there is a potential service to ensure that the entity bean's data is saved. Message-driven beans combine the characteristics of session beans and JMS message listeners, allowing one business layer component to receive JMS messages asynchronously.
(4) Enterprise Information System layer processing enterprise information system software, including enterprise infrastructure systems such as enterprise resource Planning (ERP), mainframe transaction processing, database system, and other legacy information systems. In general, it is the database and some other independent system that needs to interact with it.


References: Interactive encyclopedia and http://blog.csdn.net/wanghuan203/article/details/7100406


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.