• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

Dependent Value Classes

 
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All:
The spec says -

10.6.3 Dependent value classes
The following are the requirements for a dependent value class:
The class must be defined as public and must not be abstract.
The class must be serializable.


What is a dependent value class and what is it used for? Please provide and example of its use if possible.
Thanks,
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Keith Rosenfield
Ranch Hand
Posts: 277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vish.
I'm not completely out of the fog, but that helped.
reply
    Bookmark Topic Watch Topic
  • New Topic