With the introduction of the EJB 2.0 specification, the classic composite
entity bean design pattern became outdated overnight. In this article, I
present a new pattern that can serve as a proper replacement. This pattern,
called Delegation-Managed Persistence bean (DMP bean), allows developers to
represent objects that span multiple database tables. DMP beans provide a
better solution than the original Composite EJB pattern without making you
roll your own persistence mechanism.
Let's start with the basics. Why are composite entity beans required, anyway?
The problem is that in many cases (depending on your application server and
database), beans with container-managed persistence (CMP entity beans) can
span only a single database table. However, in many enterprise databases, a
single conceptual object is stored in numerous independent tables. The
standard practic... (more)