RE: Sets and bags / Identity of a link



Date view Thread view Subject view Author view

Guy Genilloud (guy.genilloud@fsarch.com)
Tue, 23 Jan 2001 23:44:02 -0500


Hi Gonzalo, Firstly, I would say that I am not thinking of links as *being* just tuples. They can be tuples and something more. For example, an binary association class is both an association and a class, and it is more than a set of binary tuples... Perhaps, we should speak of 1-1 or a many-1 correspondence between links and tuples... But this consideration was not my contention with UML. My contention had to do with the idea that UML should have as few constraints as possible, for the reason that it is easy to add constraints, and impossible to remove them... So, I am in disagreement with Daniel Jackson, but mostly as the core of UML is concerned. I would have no objection for profiles or modelers to insert a constraint that all (or just some) associations "are" sets of tuples. Daniel Jackson gave us some pretty good reasons why some profile should be that way. In my contribution to the UML ws at ECOOP99, I gave several reasons why UML should not have this preconstraint built-in. I repeat them here, trying to be a bit more clear than I was then. 1- Reverse engineering: the impossibility to model in a class diagram some object implementations. If two objects can have an unbounded number of links between them, the set of tuples pre-constraint makes that situation impossible to represent in a class diagram in a natural way (that is, without introducing a third object class, that has no object instances)... 2- Not always inforceable. If you are implementing a CORBA object, how do you make sure that you never get two links to a same object (remember that a CORBA object may have several different identifiers, that may not be compared for equality). 3- Modeling experts. Some very respectable experts do believe that having this pre-constraint is a bad idea. For example, the EXPRESS modeling language has both bags and sets. Of course, other experts are all in favor of it. But my argument is that adding the set constraint is easy, while removing it (if it is in the core of UML) is impossible. 4- Intuition. When I give an example with a customer having a table reservation at a restaurant, most people get it wrong at first. They don't realize that the model they propose would make it impossible for a customer to make 2 reservations for the same table at different dates... I am not (yet) on the p-uml mailing list, so please keep me posted in follow-ups to this discussion. Tx Guy Genilloud > -----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 > >


Date view Thread view Subject view Author view