EJB3.0 example tutorial study notes 1 What is EJB

Enterprice JavaBeans is a standard server-side component model for distributed business applications. Applications written using the Enterprice JavaBeans architecture are scalable, transactional, and multi-user safe. These applications can be written once and deployed on any server platform that supports the Enterprice JavaBeans specification, such as jboss, weblogic, etc.
Enterprise JavaBean (EJB) defines three types of enterprise beans, namely Session Bean (Session Bean), Entity Bean (Entity Bean) and MessageDriven Bean.
Session Bean:
Session Bean is used to implement business logic, it is divided into stateful bean and stateless bean. Whenever a client makes an EJB call request, the container selects a Session Bean to serve the client. The session bean can directly access the database, but more often, it realizes the data access through the entity bean.
Entity Bean:
As we can guess from the name, the entity bean represents the data of the real object. In EJB3.0, entity beans are only used as ordinary Java objects, which are responsible for object and relational mapping (O/R Mapping) with database tables.
Message-Driven Beans (MDBs):
MDBs are components designed to specifically handle message-based requests. It can send and receive asynchronous JMS messages and easily interact with other EJBs. It is especially suitable for a situation where a business is executed for a long time and the execution result does not need to be fed back to the user in real time.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326712103&siteId=291194637