Enterprise Java Beans(EJB) Java EE

What is Enterprise Java Beans(EJB) and what are it’s components

Enterprise Java Beans(EJB) in my my understanding is required for invocation of some methods on objects on remote machines. In other words, client will have it’s own copy of object perform the desired operation on it’s local machine and this object later will be serialized and sent to remote machine. Ex.: when you use your browser to update your personal information such as phone number, your local machine will create user object, get the updated value of phone number(user object has phone number attribute) then this object sent to the bank’s app server where the app will update the database. That’s it.

There are 3 components of EJB:

  1. Session beans. Below are the types of session beans, they all perform business service operations
    1. Stateless
    2. Stateful
    3. Singleton
  2. Message driven beans are invoked asynchronously in response to external events through association with messaging queue.
  3. Entities are objects that have unique identities and represent persistent business data. Persistent data in human language means write or read data to database.

1 and 2 considered as enterprise beans and 3 is not. (starting from ejb 3.0 entities are not beans)

Very good introduction video about EJB 3.0

Leave a Reply

Your email address will not be published. Required fields are marked *