Re: links between objects



Date view Thread view Subject view Author view

Shane Sendall (Shane.Sendall@epfl.ch)
Wed, 19 Jul 2000 14:24:07 +0200


Hello Leonor, In short, "one way" is sufficient. The asymmetic notation of OCL can be confusing in regard to bi-directional associations. For example, let AssocZ be a bi-directional association between ClassA and ClassB. ClassA--AssocZ--ClassB Then in OCL one can write (with declaration objOfA: ClassA, objOfB: ClassB) objOfA.assocZ = objOfA.assocZ@pre->including (objOfB) And this is directly equivalent to: objOfB.assocZ = objOfB.assocZ@pre->including (objOfA) Remember what we are really doing is adding a tuple (objOfA, objOfB) to the association AssocZ Cheers, Shane Leonor Barroca wrote: > Dear all > I should find it out in the OCL book but I don't have it on hand and need > to sort this one out. > I would be very grateful if someone could confirm or otherwise the following. > > When in a postcondition I want to express that there is a link between > objects a and b is it enough to say it in one direction or do I have to say > it in both directions? I am specifying operations at a high level of > abstraction and at a point where associations are all bidirectional. > > Thanks > Leonor > > To remove yourself from this list please mail puml-list-request@cs.york.ac.uk > with a message containing the word "unsubscribe". -- --------------------------------------------------------------------- - Shane Sendall - Swiss Federal Institute of Technology in Lausanne - - email : Shane.Sendall@epfl.ch http://lglwww.epfl.ch/~sendall/ - - phone : ++41 21 693 66 89 fax : ++41 21 693 50 79 -


Date view Thread view Subject view Author view