This doesn't really have anything to do with jBoss as an application server,
but is more a philisophical question involving EJBs.

What is the basic architecture for handling objects which are owned by other
objects?  Given the following example:

I have a department, and that department "owns" the employees to which it
has been assigned.  Therefore, I create my standard entity bean for the
department.

Entity Bean:  Department

I look up my home object, create my department EJB, it loads and everything
is fine.  I now want to get a list of all the employees in my department.  I
throw in a second entity bean.

Entity Bean:  Employee

What is the best recommended method for accessing the employees?

Do I say sometyhing like:  Enumeration employeeList =
Department.getEmployees();  In this case, is it OK to have one EJB look up
the home object on another and return the Enumeration returned by the find
method?

Or do I do something like:

Look up the Employee home object.  Execute a findByDeparmentID method?

Having not done this before, I value your opinion.

Thx!

Wes

--------------------------------------------
Wes McKean
Director Platform Management
U.S. South Communications, Inc.
770-240-6114
[EMAIL PROTECTED]



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to