JBoss at Work: A Practical Guide

6.4. Enterprise JavaBeans

There are three types of EJBs:

Session Beans

Session Beans allow the developer to group the steps of a business process into a single transaction. The activities contained in a Session Bean are synchronous.

Message-Driven Beans (MDBs)

MDBs are good for processing business logic asynchronously and/or executing long-running tasks in the background. They listen on Java Messaging Service (JMS) destinations (Queues and Topics) and process incoming messages as they arrive.

Entity Beans

Entity Beans are a persistence mechanism that encapsulates Create, Read, Update, and Delete (CRUD) operations on database tables.

Although some shops still use entity beans, most of the Java community has moved away from them in favor of other, more flexible third-party ORM solutions. However, the other two types of EJBs still are widely used. We'll talk about Session Beans in this chapter and MDBs in the next.

Категории