Book a Demo

Author Topic: Inheritance within profiles  (Read 2690 times)

floerio

  • EA User
  • **
  • Posts: 44
  • Karma: +0/-0
    • View Profile
Inheritance within profiles
« on: June 27, 2009, 01:14:20 am »
Hi!

Today I discovered the following behaviour during the creation of a stereotype: I have a metaclass that includes the options "_makeComposit" and "_defaultDiagramType" to create the diagram during object creation.

If then I directly extend to a stereotype class everything works fine: The composite diagram will be created as soon as I drop the element on a diagram.

Now I want to inherit to more than one stereotype. And, beeing a brave child of object oriented design I added first an "abstract" class that holds the common tagged values and then, from this class, inherit to multiple stereotypes.

The TVs defined in the abstract class are then in fact correct included within the derived stereotypes. But the default diagram does not work any longer. Even if I (against the description of the manual) put the two attributes in the abstract class.

I double checked it: If I extend one of the classes directly from the metaclass it works perfectly.

So how should I use the idea of generalization if suddenly the system does not behave as planned?

Currently I see no other way then to add to each single stereotype the attributes and then extending directly from the metaclass. Which is not the way a UML model in a UML tool should behave, should it?

Did I something wrong?

Cheers,
   Oliver

Nick Webb

  • EA User
  • **
  • Posts: 28
  • Karma: +0/-0
    • View Profile
Re: Inheritance within profiles
« Reply #1 on: October 30, 2009, 02:59:12 am »
Have just run into this one myself - it appears to work if I:

1. Add a new metaclass
2. Set _defaultDiagramType in new metaclass
3. Add extends connectors between stereotypes and new metaclass

...  I wonder if metaclass supported attributed are only inherited by extending stereotypes?

HTH

Nick