The technology has been applied to the development of large-scale network system more and more, in this paper, the author will introduce the definition of EJB (Enterprisejavabeans), the structure model of application system based on EJB technology and the content and classification of EJB component, Finally, a business reservation system is developed with EJB based structure model and EJB component.
EJB is technically not a "product", but a technical specification. Sun's definition of EJB is that the EJB structure is a component structure for developing and configuring a distributed business application based on components. Applications developed with EJB architecture are scalable, transactional, and multi-user-safe. These applications may only be written once, but can be configured on a task server platform that supports the EJB specification. In general, EJB is a standard server-side component model for component transaction monitoring.
The system structure model based on EJB technology
The EJB structure is a service-side component structure, a hierarchical structure, and its structural model is shown in Figure 1. The structure model can be divided into the customer layer, the business logic layer and the data layer under normal circumstances, and the following author makes a brief introduction.
Figure 1: An application architecture model based on EJB
The customer tier is primarily designed to meet the various access requirements for the entire system and to handle the following tasks:
The user input can also be analyzed and checked and processed accordingly.
Displays the results of the run from the server-side hierarchy.
The customer layer is typically composed of customer processes that are dynamically created and revoked by the browser.
Business Logic Layer This is the most critical part of the entire system. The business logic layer is typically divided into two tiers, the high-level of which is the request-receiving layer (commonly called the web layer), which receives requests from the browser and sends the request to the underlying process, sending the request processing results to the browser. These processes consist primarily of JSP pages, web-based applets, and servlets that display HTML pages. The underlying level is the request processing layer (commonly called the EJB layer), this includes monitoring processes, process processes, and database operation processes that handle and process client requests from the receiving layer, as well as passing the request results to the request layer and, if necessary, handing the results to the data tier for storage.
The data layer is mainly for the business logic layer to provide data services, such as the storage business logic layer processing results, return to the business logic layer of data retrieval results, but also in order to achieve the shielding data source changes, so that when the database changes we only need to modify the statement connected to the data source.
Classification of EJB components
Typically, the server-side EJB component has two basic types: Entitybean (Entity Bean) and Sessionbean (Session bean).
Figure 2: Architecture of the Business reservation system