Folks,

I have 3 Entity Beans: Organisation, Contact and Address.
An Organisation can have many Contacts, and each Contact has 1 Address.

The system Value Objects are built by ModelFactory classes that call the
entity beans.
Action classes provide the procedural logic.
Stateless session beans provide a facade onto the modelfactories and
actions, and are the client facing components.


My question is how best to model the 1 to many relationship between the
entity beans?


Currently an Organisation retrieves the primary keys of its Contacts,
however the retrieval of the Contact bean proper is done by the Organisation
Value Object Model Factory.
When updating an Organisation, the UpdateOrganisation Action class is
responsible for updating the Organisation,  then updating that organisations
Contacts.

This all works, however it was suggested to me recently that the Entity
Beans should completely manage the 1 to many relationship. i.e. The
Organisation bean should update all its contained contact, calling the
Contact bean directly (instead of the UpdateOrganisaton action doing it).


It strikes me that this makes the entity beans quite complex.


Are there any opinions on the best approach?


Thanks - Adam

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to