The Internet and the popularity and development of e-commerce technology have driven the construction and update process of enterprise information systems. In order to shorten the design and development cycle of the enterprise information system, reduce the cost of building a corporate information system, and quickly reflect the changed business rules in the existing system, Sun has developed Java2 SDK Enterprise Edition (J2EE) specification, defined Components are designed, developed, assembled, and deployed into various components of the enterprise application system. The J2EE specification defines distributed multi-layer application system models, component reuse policies, consistency security models, and flexible transaction control policies, etc., so that the independent software provider (ISV) can launch a user with a faster speed than before. Adaptive customer solution. In addition, the platform is independent, and the J2EE solution based on component technology is not restricted by software product types and different application environments.
Distributed multi-layer application model
In an actual constructed enterprise information system, you need to deploy different nature and use components to different types of application servers based on the distributed multi-layer application model defined by the J2EE specification. The J2EE specification is divided into a client layer, and the intermediate layer (which may include web layers, business layers) and enterprise information system layer three-layer structure, as shown below. Each application layer is configured in different types of application servers, respectively.
Figure 1 logic layer based on enterprise application system based on J2EE specification
The client layer customer layer is used to interact with the user of the enterprise information system and display the results after calculation according to a particular business rule. The client based on the J2EE specification can be web-based, or it is not a Web-based independent application. In web-based J2EE client applications, users download the static HTML page in the web layer in the web server after the client is launched, or the HTML page dynamically generated by JSP or servlets. In a Web-based J2EE client application, a separate client application can run in some network-based systems such as handheld devices or car phones, etc. Similarly, these independent applications can also run in the Java applet of the client. This type of client application can directly access the EJB component in the EJB container (EJB Container without the Web layer. Similar to the presence of database records in the database table, the primary key object for identifying the entity component is defined in the physical component. The primary key corresponds to the primary key identified by the database table, which represents the primary key value of the entity component recorded in the same database. The client application can use the primary key to locate the entity components in the EJB container, thereby positioning the database record represented by the entity component. According to the lifetime management method of the entity component, the EJB specification divides the entity components into two types of bean-management persistence, BMP and Container-Managed Persistence, CMP. During the component deployment, the deployment tool writes component status conversion code for the container management persistence type EJB component, and the EJB container calls these methods to implement the status of components. Relays, component programming must write control components for the creation, deletion, activation, and closing of the constitutive period measurement for the component management Percuator Type EJB components. SQL code. ◇ Message Driven BEAN is a new component introduced in the EJB2.0 specification for providing a component type mechanism responding to an external event message in the EJB container. Prior to introducing a message-driven type EJB component, J2EE-based distributed applications For the processing of event messages, using a separate Java event handler to listen to the client application, EJB component, JSP components, even the J2EE platform. The source is made in accordance with the Java Message Service, JMS) specification event message. After introducing the message-driven type EJB component, deploy the message drive type EJB component in the EJB container to listen to the message from the event source and reflect, which can call other types of components to respond to messages. Message Drive Type EJB Components As the event listener in the EJB container, the message drive component object instance can be activated by the EJB container after receiving event messages from the JMS message queue. The message driver component is the stateless type component of the server side. This type of component is only a component class definition, does not similar to the HOME interface and remote interface of the session component and entity component. The developer role EJB component architecture of the EJB specification defined is based on the main part of the application software system built based on the J2EE specification. The core content of a complete J2EE application is to encapsulate business logic EJB components. According to the definition of EJB2.0 specification, the distributed computing architecture based on EJB specification consists of six roles. These six roles can be software development teams, system software vendors, application software integrators, etc., each role is completed. Work must follow the EJB specification to ensure compatibility between each other. These six roles are: ◇ EJB Component Developer EJB Component Developer (Enterprise Bean Provider) Responsible for developing EJB components that have business rules.
EJB Components Developers Define the Home Interface and Remote Interface of the EJB component, write component classes and provide deployment description files deployed for EJB components (Deployment Descriptor). EJB Components Developers are experts in the business application development field, and there is no need to master the system-level programming method and system-level component transaction management, synchronization, security, distributed calculation and other details. ◇ Deployers Deployers (deployer) is responsible for deploying the packaged EJB components to an application environment such as an EJB server. Deployers should configure EJB servers to configure EJB servers based on the needs of various types of resources, such as database, security management, etc. in the deployment description file of EJB components. Deployers are experts from EJB applications. ◇ Application Assembler Application Assembler is responsible for combining various types of EJB components into a complete application system, so application assembers must explicitly to assemble the HOME interface of the EJB component and the Remote interface definition of the Remote interface definition. ◇ EJB Server Provider EJB server is usually available by operating system developers, middleware developers, or database developers. Therefore, the EJB server provider (EJB Server Provider) is an expert in the field of application, proficient distributed system management, distributed object management, and other system services. ◇ EJB Container Provider EJB Container Provider (EJB Container Provider) is a system-level programming expert, and its work is mainly focused on the development of scalable, transactional, transaction, and security management functions in EJB containers in the EJB server. The EJB container provider provides a set of standard APIs to EJB component developers to access the EJB container, so that EJB component developers do not need to understand the various technical details in the EJB server to develop EJB components in the EJB container. In practical applications, typically assume that the EJB server provider and EJB container provider come from the same software developer, and thus does not define the interface criteria between the EJB server provider and the EJB container provider. ◇ System Administrator is responsible for providing an enterprise-level computing environment for the EJB server and EJB containers and utilizing the EJB server and EJB container to monitor the operation of EJB components. EJB Components in the EJB Container Enterprise Information System Business Layer is usually deployed in applications called EJB containers, providing state management, transaction management, thread management, remote data resource access, connection management, and security of EJB components by EJB containers. Management and other system level services. All EJB component instances are run in the EJB container, and the EJB container controls the lifetime of the EJB component. The EJB component can be customized to provide various system-level services such as security and transaction processing, but these service features are essentially the EJB component class, but is provided and implemented by the container deployed EJB components. Any EJB components written in accordance with the EJB specification can be deployed to any EJB container compatible with the specification, which can be managed by the EJB container according to the needs of the application system to manage the transaction or security of the components. Separate the processing function of the business logic with the underlying application system service logic during the EJB component deployment, so that the EJB container can create and manage EJB components when runtime (Runtime). In the second lecture of the EJB series of reception on November 28, we will detail the basic structure of the EJB component. The Web layer J2EE specification defined Web layer consists of a JSP page, a web-based Java Applets, and servlets for dynamically generating an HTML page. These basic elements create a web component in the assembly process. The web component running in the web layer relies on the Web container to support functions such as responding to customer requests and query EJB components. The business layer is built into an Enterprise JavaBean (EJB) component that resolves or meets the code of business rules in specific business sectors based on J2EE specifications. The EJB component can complete the data from the client application, and process the data according to the business rules, send the processing result to the enterprise information system layer for storage, retrieve data from the storage system and send data back to the client. Deploying and running EJB components in the business layer depends on the EJB container to manage, such as transactions, life, status conversion, multi-threading, and resource storage.
Thus, the intermediate layer in a multilayer distributed application system is constituted by the service layer and the web layer. In the logic layer division of the enterprise application system, enterprise information system layers typically include enterprise resource planning (ERP) systems, mainframe transaction processing systems, relational database systems (RDMs) and other construction J2EE Enterprise information management software in distributed application systems. J2EE platform application programming environment
The programming environment of the distributed application system is usually divided into the following four types as follows: ◇ EJB container EJB container is used to provide development, deployment, and operational environments of EJB components. ◇ Web Container Web components are used to provide display logic of application systems, while web containers provide environments suitable for servlet and JSP development, deployment, and running. ◇ Customer Appliance Appliance Application Vesel is used to provide a client operating environment of a distributed application system, which is essentially J2SE. ◇ Applet container provides a browser running environment suitable for Java Applet.
ENTERPRISE JAVABEAN specification basic characteristics