Not the usual, I promise.

I have an Organization.  It is an EntityBean.  It wholly contains
OrgUnits.  They are not enterprise beans since they are dependent
objects, and since it appears like a Good Thing to reduce the number of
EntityBeans needed in an architecture.

But now each OrgUnit logically needs a reference back to the
Organization that owns it.  Can I simply keep a reference to the
Organization that creates an OrgUnit?  Should I store the handle
instead?  Or the OrganizationHome?  Or what?

Sample, shortened code follows:

  // Remote reference for OrganizationBean class--
  // the OrganizationBean class implements EntityBean.
  public interface Organization extends EJBObject {
     public OrgUnit[] getOrgUnits();
  }

  public class OrgUnit {

    // OK?  Bad?  Organization is an EJBObject.
    // Does this matter?
    private Organization org = null;

    public OrgUnit(Organization org) {
      super();
      this.org = org; // OK?  Bad?
    }

    public Organization getOrganization() {
      return this.org; // OK?  Bad?
    }

  }

Cheers,
Laird

===========================================================================
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