I am trying to model a Person having many Phones with two Entity beans.
Person and Phone are both entity beans.  But I do not want to allow anyone
to manipulate the Phone directly.  I only want Person to be able to:

Person.addPhone(PhoneValue)
Person.removePhone(PhoneKey)
Person.updatePhone(PhoneKey, PhoneValue)
Person.getPhones().

In other words, Phone is treated like a dependent (except on advice of
others, I have stopped using dependent objects).

Is there a way I can enforce this?  In other words, how can I stop any one
except Person, from using the PhoneHome/PhoneBean directly?  The reason I
need to do this, is because Person performs additional logic when phones are
added or removed or changed.  This logic, must always be performed, so I do
not want someone to use the PhoneHome to find the Phone and change it
without the person knowing.

-AP_
www: http://www.standardset.com
resume: http://www.standardset.com/resume_body.jsp
home: (818) 541-0029


Reply via email to