Here is design approach I use for modelling associations between entities:

Let's say, there are three Entities A, B, C - all are implemented as Entity
EJBs.

Imagine that they cooperate forming an association, so whatever happens to
A, or B, or C,
happens in terms of their participation of this association.

(1) In other words, if something happens to B, it happens to B not as such,
but to B as part of
a larger something - an association of A, B, C.

(2) Now, imagine, something else happens to B, and this something has
nothing to do with
an assocaioation, of which B is a member. This something is inherent feature
of B as such.

NB: When I say "something happens to X", it can be interpreted as " a method
involving an instance of class X is invoked".

Continued:

If (2) is the case, I model "something" method as method of B class.

If (1) is the case, I create AssociationABC class and "something" method
becomes a method of AssociationABC class.

In other words, associaton class governs behaviour of both A, and B, and C,
when this behaviour has
something to do with their cooperation as members of association.

Any behavior inherent to A, or B, or C, as such, not as member of
association, is governed by
A, or B, or C itself, not by assocaion class.


Viktor Gritsenko, a Generic Semantic Associations guy.

----- Original Message -----
From: Rickard �berg <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 14, 2000 4:29 AM
Subject: Re: MI2: Strategies to reduce EJB development time?


> On Thu, 13 Jul 2000 13:03:22 -0700, J. Matthew Pryor <[EMAIL PROTECTED]>
> wrote:
>
> >OK so here is another issue I have with this "Business Interface" design
> >pattern that I can't think of a good solution for.
> >
> >Say I have 2 business interfaces : BusinessInterfaceA &
BusinessInterfaceB
> >
> >I define my 2 "local" or BO interfaces (and sure all the methods have to
> >throw RemoteException)
> >
> >But what if I want to model an association between BusinessInterfaceA &
> >BusinessInterfaceB
> >
> >I can't write a method on BusinessInterfaceA like:
> >
> >public BusinessObjectB getAReferenceToYouWellKnownFriendMrB() throws
> >RemoteException;
> >
> >Because when I move to my "remote" version of BusinessInterfaceA, the
return
> >type of the method would need to change to
> >
> >public RemoteBusinessObjectB getAReferenceToYouWellKnownFriendMrB()
throws
> >RemoteException;
>
> Why? :-)
>
> RemoteBusinessObjectB extends BusinessObjectB. Thus, RBOB can be cast to
> a BOB. Hence, the method can return BOB, which could be an instance
> implementing RBOB.
>
> Explain, very explicitly, what is the problem? I don't see it.
>
> regards,
>   Rickard
>
> --
> Rickard �berg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.telkel.com
> http://www.jboss.org
> http://www.dreambean.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".
>
>

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