Objective 4.1: List the required classes/interfaces that must be provided for an EJB technology
Enterprise Java Beans
Although the objective does not state that you need to know what an EJB actually is, let's fill in this ommission first:
Basically, an EJB is a server side component that encapsulates business logic.
There are three types:
- Session Bean
- Entity Bean
- Message Driven Bean
Besides the business logic encapsulated in the bean (usually written by you), the bean container decorates the bean with system level features like:
- Distributed Transactional support
- Security
- Resource pooling
- Persistence
And to complete the list, EJB's are useful because:
- They enforce a good separation of presentation, business logic and data storage
- They are portable to other J2EE vendors
- They are vertically and horizontally scaleable
Applies to: Session Bean and Entity Bean
The home interface provides ways of creating and finding a bean.
The home interface must extend javax.ejb.EJBHome
Applies to: Session Bean and Entity Bean
The component interface provides the business methods for the bean to the client.
The component interface must extend: javax.ejb.EJBObject
Applies to: Session Bean, Entity Bean and Message Driven Bean
The bean itself. The bean class implements the business methods of the bean.
Depending on your needs, the bean class either implements javax.ejb.SessionBean or javax.ejb.EntityBean or javax.ejb.MessageDrivenBean