EJB

Benifit of using EJB

  • Simplify development of large distributed applications

  • Tiered approach, because EJB container is responsible for transaction management and security authorization, client and bean layers are thinner.

  • Portability, the integration of new application with existing beans are easier if application can use same APIs.

Types

Session Bean - represent a SINGLE client inside the application server. It's NOT persistent. It allows synchronise messages.

Message Driven Bean - similar to stateless Session Bean, can handle requests from multiple clients concurrently. It allows asychronise messages.

Entity Bean - In J2EE 5, it has been replaced by Java Persistence API Entity.