Entity beans, on the other hand, are heavyweight, application server-specific components designed to be used in the data-tier of a distributed system. The EJB specification defines a framework that removes a lot of the redundant infrastructure worries, e.g. lifecycle management, away from the developer. However, this forces an entity bean developer to become involved in working with multiple interfaces, a deployment descriptor and the EJB framework itself. A developer must also test an entity bean in the environment that it will be deployed in.
JDO can actually be used by an EJB container provider as the implementation for container-managed persistence (CMP). Likewise, JDO can be used by a developer as the implementation for bean-managed persistence (BMP).
The decision to work with entity beans vs JDO is most likely determined by the amount of complexity embodied within a data resource and by the experience level of a particular development staff. Also, if an application or system is designed on top of the data tier, entity beans might provide a simple means to bridge the gap between data and business logic. If the application or system is designed on top of a services/business-logic tier, JDO might prove more appropriate.
This was first published in October 2002