Dependent classes are Value Objects. They are mostly read-only, implement Serializable and have public members. Since EJB data can be wrapped in one single Object(Dependent class), they tend to reduce the number of remote calls. I could think of this example: In a BMP Entity bean scenario...Order and Orderline Items. Order can be an Entity bean but Orderline Item need not necessarily be an Entity bean. Orderline Items could be a collection (Vector/ArrayList) of Orderline Items defined as a member inside the Order Entity bean. Each Orderline Item is defined as a simple Java class implementing Serializable. The Collection of Orderline Items is populated/updated in ejbLoad()/ejbStore()...A public method could be exposed in the remote method to access the Orderline items. In this scenario, Orderline Items are called Dependent classes.This kind of a strategy improves the performance of a BMP entity bean. You can implement the above scenario using a CMP2.0 Entity beans also without using any dependent classes, but that is a design decision... Hope that helps!
posted 16 years ago
Thanks Vish. I'm not completely out of the fog, but that helped.
Keith Rosenfield<br />SCJP<br />SCWCD<br />SCBCD
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Devious Experiments for a Truly Passive Greenhouse!