Yangyang is starting to learn J2EE today!
Objective: Understand the J2EE architecture in the shortest possible time, and then slowly learn from the depths.
Come on! Come on! ! Come on! ! !
First, distributed multi-layer applications
Figure 1 Distributed multi-layer application
J2EE platform uses multi-layer distributed application modes. Application logic is divided into multiple components according to its functions, and various different application components constitute a J2EE program distributed on differently dependent machines. Components located in different layers are:
☆ Customer layer component running on the client
☆ Network layer running on the J2EE server
☆ Logical layer running on the J2EE server
☆ Enterprise information layer running on the EIS server
Although the J2EE application can consist of three or four layers, J2EE applications are typically composed of three layers because they are distributed in three different locations: clients, servers, background database servers. Three-layer application model running in this way expands two-layer mode based on customer / service.
Conclusions from the map can be drawn:
1, J2EE application is usually composed of three layers: customer layer, intermediate layer, corporate information system layer (EIS)
2, the intranet does not directly access the EJB (Enterprise Javabeans) container and web container through the client of the firewall; and the client outside the firewall can only access the web container directly, this part of the customer can only pass the web container. Access EJB container;
3, all customers can only access EIS through the EJB container.
J2EE components
J2EE application consists of components. The J2EE specification defines some of the following components:
☆ Operating app clients and applets in the client.
☆ The servlet & JSP component running on the server network.
☆ Enterprise logic components running on the server - EJB.
J2EE client
Internet browser
Applets
Application client
JavaBean component structure
Network component
Business logical component
Enterprise beans can retrieve data from the memory, if necessary, and then send it to the client.
There are three EJBs: session beans, entity beans, and messaging beans.
The session bean represents a short-lived session, when the customer ends execution, the session bean and its data disappeared. Compared with session beans, entity beans are stored in the database of the database. If the client ends the program or the server off, the potential service method will store the data.
Second, J2EE container
The container is an interface between the component and the underlying specific platform (such as a database) of the component function. Before running web components, enterprise beans, you must assemble them into a J2EE application and deploy them into the container.
Figure 2 J2EE Server and Container
J2EE Server (J2EE server)
J2EE The runtime service section of the product. A J2EE server provides an EJB container (EJB Container) and a Web Container.
EJB container
Manage the operation of the enterprise bean in the J2EE application. Enterprise beans and their containers are running in J2EE.
WEB container
Manage the JSP page and the Servlet component in the J2EE application. Web components and containers are also running in J2EE services.
Application Client Container (Application Client Vault)
Manage the operation of the application client component. The application client and its container are running on the client.
Applet Container (Applet container) manages the operation of the applet. Composed of browsers and Java plugins running on the client.