Ask the Expert

When would I choose entity beans (CMP or BMP) over JDO?

When would I choose entity beans (CMP or BMP) over JDO?

    Requires Free Membership to View

Java Data Objects (JDO) deals with persisting an object model and its data. The persistence implementation is separated from the actual data interface. This allows a developer to design and implement an object's logic and data-storage logic separately. JDO is designed to be work in different tiers of a distributed system. JDO is a lightweight persistence mechanism that adds little or no additional compile-time code.

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: