On Fri, 2 Mar 2001, Alex Smith wrote:

> Dan Christopherson <[EMAIL PROTECTED]> wrote:
>
> >I'd say that the dependent object has no identity that is meaningful
> >outside of the context of its parent.
>
> Right.
>
> >If you have three dependent
> >instances of the same class associated with the same parent, they must
> >have their own identities if you do not consider them equivalent, right?
>
> It's up to the parent to the distinguish between them; this is usually done
> on the basis of a property meaningful to the parent. Example: a user has a
> profile that specifies his preferences (timezone and date/time formatting).
> If there are multiple profiles, it makes sense for the user to name each of
> these profiles and for the app to enforce the constraint that will not allow
> the user to use the same profile name on more than one profile.
OK, I think we're on the same page now. I'd call that meaningful property
(possibly in combination with the parent key) a primary key. Much to my
own chagrin, I'm showing my relational roots, here. From a pure object
point of view, or in an object database, I'd feel no need to say 'key' at
all.

>
> A more interesting question is whether the above will always hold true and
> based on my experience I can say that it can be made true if the application
> architect understands the nature of the dependency. This would be a "proper"
> way to model a relationship but the spec opts for an easier solution which
> requires the bean provider to write a primary key class for the dependent
> class. Fair enough but why should that be mandatory, especially in cases
> where there's a 1:1 rather than 1:N relationship between the parent and the
> dependent object?
I agree. Although I'm also used to using the same primary key for a 1:1
case.

Out of curiosity, how do you go about modeling M:N relationships in
EJBs?

>
> Alex Smith
> Insight LLC
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
> ===========================================================================
> 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".
>

--
Dan Christopherson (danch)
nVisia Technical Architect (www.nvisia.com)

Opinions expressed are mine and do not neccessarily reflect any
position or opinion of nVISIA.

---------------------------------------------------------------------------
If you're a capitalist and you have the best goods and they're
free, you don't have to proselytize, you just have to wait.
-Eben Moglen

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