RE: Sets and bags / Identity of a link



Date view Thread view Subject view Author view

Daniel Jackson (dnj@lcs.mit.edu)
Tue, 23 Jan 2001 11:45:29 -0500


gonzalo, i don't know what the semantics of UML is, but here's what it should be :-). an association should be a binary relation: that is, a set of tuples. here's why: 1. a set of links is much more cumbersome to handle semantically. navigation is no longer just relational image. 2. it's phenomenologically spurious (see chapter on "designations" in: M. Jackson, Requirements and Specifications, Addison Wesley 1995). we won't want an abstract model to make distinctions that we can't make in the real world. for example, if the parent association is a set of links, we'll have to explain what the difference is between Alice being Bob's parent under link L1, and Alice being Bob's parent under link L2. 3. relations are a more basic notion, and therefore deserve to be built-in. you can always get create a set of links explicitly using binary relations, but hiding the links identities is harder. 4. links would increase the complexity of analysis. our Alloy Analyzer can generate snapshots and check properties of object models automatically. with links, it would not be able to handle such large models. 5. what would it mean to have two distinct links that link the same objects? this might sometimes be useful, but then you should just construct a link object specially. in the general case, it will be tedious and obscure to have to rule this out. /daniel -------------------------------------------------- Daniel Jackson Associate Professor, Computer Science Massachusetts Institute of Technology http://sdg.lcs.mit.edu/~dnj ....-----Original Message----- ....From: Gonzalo Génova [mailto:ggenova@inf.uc3m.es] ....Sent: Tuesday, January 23, 2001 11:33 AM ....To: puml-list@cs.york.ac.uk ....Cc: 'Guy Genilloud'; Juan Llorens; J.Miguel Fuentes Torres ....Subject: Sets and bags / Identity of a link .... .... ....Hello pUML members, .... ....The UML defines a Class as a set of objects (UML v1.3, p. ....60). This should ....not prevent two objects of the same class to have the same ....data content, ....that is, to have the same attribute values, to be in the ....same state (say, in ....a graphical worksheet, two Points have the same ....coordinateX, coordinateY and ....color, but they are nevertheless differentiable because ....each one has its own ....identity). That is, within an object we can distinguish ....identity from data ....content. .... ....Similarly, the UML defines an Association as a set of ....tuples (p. 55). On the ....other hand, being a link an instance of an association, an ....association is ....also a set of links. Is a link and a tuple exactly the same ....thing? Martin & ....Odell, in their book "Object-Oriented Methods: a ....Foundation", rather say ....that the instance of the association is the tuple itself, ....that is, the ....identity of the association instance is the composition of ....the identities of ....the linked objects. But others say that "the data content ....of a link is a ....tuple" (Joaquin Miller, in a message posted to this forum a ....year ago--excuse ....me if the intention is misundertood), thus enabling the ....distinction between ....identity and data content of a link, in a closer analogy ....with objects. Other ....attributes owned by the link might form part also of its ....data content. If we ....followed this interpretation, then we could have sets of ....links, some of ....which would have the same data content (would relate the ....same objects), but ....being nevertheless distinguishable (a client having several ....reservations for ....the same table in a restaurant). Unfortunately, the UML ....standard states that ....each tuple may appear at most once in an association. .... ....Guy Genilloud, in his contribution to the UML Semantics ....FAQ, in the 1999 ....Ecoop workshop, proposes to remove this constraint, ....defining an association ....as a bag of tuples (a bag instead of a set). This could ....work, but the ....analogy between links and objects would become weaker. ....Should we say also ....that a class is a bag of objects? Personally, I prefer the ....other solution. ....If we admit that classes are sets of objects, allowing ....different objects to ....have the same data content, why not admitting that ....associations are sets of ....links, allowing in an analogous way that different links ....have the same data ....content (that is, link or relate the same objects)? I think ....we need that ....links have an identity that is different from the composition of the ....identities of the related objects, in order to manipulate ....them (the links) ....more clearly. A link identity makes unnecessary to discuss whether ....associations should be sets of tuples or bags of tuples. ....(This link identity ....is not to be confused with a "link identifier", as the ....object identity is ....not to be confused with the "object identifier", some kind ....of invisible ....attribute that would ease the identification of the object; ....but I don't want ....to extend now on this point.) .... ....I expect your comments. ....Gonzalo Genova ....Carlos III University of Madrid, Spain .... .... .... .... ....To remove yourself from this list please mail ....puml-list-request@cs.york.ac.uk ....with a message containing the word "unsubscribe". ....


Date view Thread view Subject view Author view