Re: modeling link creation



Date view Thread view Subject view Author view

John Daniels (jdaniels@cix.co.uk)
Fri, 14 Jan 2000 12:33 +0000 (GMT Standard Time)


Gonzalo, In the UML notation guide section on Collaboration Diagrams it says: ----snip---- A collection of standard constraints may be used to show whether an Object or a Link is created or destroyed during the execution: Objects and Links created during the execution may be designated as {new}. Objects and Links destroyed during the execution may be designated as {destroyed}. Objects and Links created during the execution and then destroyed may be designated as {transient}. These changes in life state are derivable from the detailed interaction among the Objects, they are provided as notational conveniences. ----end snip---- As it says, you can annotate a collaboration diagram to show what you want. Since sequence diagrams are supposed to be semantically equivalent I guess you can do it with those, too, but I'm not sure how. Alternatively (or as well), the creation of a link is something you might specify in a post-condition of an operation, using OCL. --John ========================================================================= John Daniels Syntropy Limited -------- Original Message -------- Hello, My name is Gonzalo Genova from Carlos III University of Madrid, Spain, and I have recently registered to pUML list. My question may seem very simple, but I have seen it neither clearly explained nor well resolved in the official UML documentation. It may also happen that I have not understood some basic principle, and the question turns to be irrelevant, as someone has already told me. I will try to be very brief, although if someone is interested, I can delve into the argument. Here comes the question: How do you model the creation of a link between two object instances? (understanding "link" as "instance of an association", not as the association itself; once the system is running, the associations do not change, but the links do, they may appear and disappear). Using the well-known example, "Acme hires John Doe", where "Acme" is an object of class Company, "John Doe" is an object of class Person, and "hires" means the establishing of a link between "Acme" and "John Doe". The question seems important to me because the existence or absence of links between object instances is part of the state of the system; if you want to model the evolution of the system, which objects exist at every time and which values have their attributes, and how they change along time, you should model also the changes in the links between objects. In UML we have standard ways to represent the creation and destruction of object instances within interaction diagrams, via stereotyped messages (see for example UML User Guide, p. 211). But it seems there is not a standard way to represent the linking of two objects (at least, UML User Guide shows none). There may be other conceptual problems concerning the UML metamodel regarding link creation and destruction, but I leave them for those really interested. Thanks, Gonzalo 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