Re: links & messages



Date view Thread view Subject view Author view

Heinrich Hussmann (Heinrich.Hussmann@inf.tu-dresden.de)
Wed, 19 Jan 2000 16:19:31 +0200


Gonzalo Genova wrote: > > According to UML User Guide, p. 209: "wherever there is a link between two > objects, one object can send a message to the other object", and p. 210: "A > link specifies a path along which one object can dispatch a message to > another (or the same)". In my understanding, the semantics is as in OO programming languages: An object can send a message to any other object it knows about. And a link between object OB1 and OB2 is the UML representation of the fact that these objects know about each other. > > Does this mean that an object can send messages only to those objects with > which it is linked? Or should we understand the word "link" less rigorously, > in the sense of "association"? Were this the case, then an object OB1 of > class CL1 could send a message to any object OB2 of class CL2 whenever an > association AS12 exists between classes CL1 and CL2, regardless of the > existence of a concrete link (association instance) between OB1 and OB2. > What is the precise semantics of UML in this case? A link can exist only as an instance of an association. And an object needs the identifier of a concrete other object in order to send there a message. So the existence of an association between the respective classes does not yet enable the possibility to send a message. > > This problem is related to the question I posed some days ago (modeling link > creation), in the sense that if you allow the sending of messages only > through concrete links, then the question arises, How is the communication > achieved between objects that are not yet linked? There is always a number of initial objects which correspond with the outside and which have links to other objects. -- Heinrich Hussmann Dresden University of Technology Department of Computer Science


Date view Thread view Subject view Author view