EJB for J2EE,
EJBIt is sun's JavaEE server component model. Its greatest use is to deploy distributed applications. EJB standardizes the deployment and development of server components developed using java. With the advantages of cross-platform java, distributed systems deployed with EJB technology can be not limited to specific platforms.
EJBEnterprise JavaBean is a part of J2EE and defines a standard for developing multiple Enterprise applications based on components. It features network service support and core development tools (sdks ).
In J2EE, Enterprise Java Beans (ejbs) are called Java Enterprise Beans and are the core code of Java.
The EJB standard object types are Session Bean, Entity Bean, and MessageDriven Bean ).
1. Session BeanIt is used to implement business logic, including stateful Session bean and stateless Session bean. Each time a client requests a Session Bean, the container selects a Session Bean to serve the client. Session Bean can directly access the database, but in more cases, it will implement data access through Entity Bean.
2. Entity BeanIt is a domain model object used for O/R ing. It maps table records in the database to Entity objects in the memory. In fact, creating an Entity Bean object is equivalent to creating a new record, deleting an Entity Bean deletes corresponding records from the database at the same time. When an Entity Bean is modified, the container automatically synchronizes the status of the Entity Bean with the database.
3. MessageDriven BeanIs a new enterprise Bean introduced in EJB2.0. Based on JMS messages, it can only receive and process JMS messages sent by the client. MDB is actually an asynchronous stateless Session Bean. After the client calls MDB, it does not need to wait and returns immediately. MDB processes client requests asynchronously. This is suitable for scenarios where requests need to be processed asynchronously, such as order processing. This avoids the client from waiting for a method call for a long time until the returned result is returned.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.