Definition of tagged values



Date view Thread view Subject view Author view

Lars Rosenhainer (lars.rosenhainer@informatik.tu-chemnitz.de)
Thu, 31 Jan 2002 09:59:00 +0100


Hello, I have a question concerning the definition of tagged values and hope that anyone can help me. According to the UML 1.4 specification the meta-class "TaggedValue" is defined as a subclass of meta-class "ModelElement". However, "ModelElement" itself contains an aggregation link to "TaggedValue" (cp. page 2-76). On the one hand this makes sense to me because a tagged value *is a* model element and tagged values can be attached to each model element. On the other hand this modelling appears odd to me since "ModelElement" is defined at a moment when its subclass "TaggedValue" is yet unknown. Nonetheless, "ModelElement" has to know this class in order to be fully defined. Compilers have no problems with source code which represents class relationships like this because e.g. forward declarations can be utilized. However, my question is: What should I think about the manner "ModelElement" and "TaggedValue" are defined? Is this it a good OO modelling style? I thought over this problem to find out if there is any real-world example where a similar modelling would be possible. And I really found one. Imagine a class "human being" and a class "parent" being a subclass of "human being". Since each human being has parents a corresponding aggregation link could be added to "human being". However, there is at least one different option to model this state-of-affairs: By not introducing a subclass "parent" but simply adding an aggregation link to human being which ends in this class itself and naming it "has parent". This would solve this problem but not the one mentioned above. Thank you for your help. Lars Rosenhainer


Date view Thread view Subject view Author view