[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.uml2] Does multiple inheritance on stereotypes cause any stereotype properties ot be duplicated ?

James,
I saw your response only now (sorry for that), and it seems I should answer your question since it may change the picture I currently have.


On the element in question, only one stereotype is applied, which inherits a base stereotype multiple times ("diamond inheritance").

The scenario is as follows:

- Stereotype CIM_Qualifier_Abstract:
  extends nothing
  owns property Abstract

- Stereotype CIM_Class
  extends Class (non-required)
  inherits from CIM_Qualifier_Abstract

- Stereotype CIM_Association
  extends AssociationClass (non-required)
  inherits from CIM_Class, CIM_Qualifier_Abstract

There is a reason why CIM_Qualifier_Abstract gets again inherited into CIM_Association when it already gets inherited into CIM_Class, and I can explain that if needed but will leave it away for now.

The element in question is an AssociationClass to which (only) CIM_Association is applied. Should it have the Abstract property once or twice ?


Andy

James Bruck wrote:
Hi Andreas,

My initial interpretation was that 2 stereotypes were being applied ( half
of the diamond ) instead of the one stereotype at the bottom of the diamond.
If 2 were applied, I believe in that scenario you would see duplicate
properties of the common stereotype.

In your scenario, you are applying one stereotype at the bottom of the
diamond.

Please correct this if I'm wrong.

Andreas, sorry if that mislead you.

- James.


"Andreas Maier" <maiera@xxxxxxxxxx> wrote in message news:eg058b$i15$1@xxxxxxxxxxxxxxxxxxxx
Kenn,
yes this is "diamond" inheritance. There is no other definition of
something called "Abstract", besides the one stereotype property that
due to diamond inheritance gets inherited through two paths.

I like your view that there should be only one occurrence of the
property, despite the diamond inheritance.

Kenn Hussey wrote:
Andreas,

The situation you are describing is what I often to refer to as "diamond
inheritance", and ordinarily I would expect to see only one set of
values
for properties that are defined only once within a hierarchy (no matter
how
many times they are directly or indirectly inherited). Has a different
property named "Abstract" been defined more than once within the
stereotype's hierarchy? This  name qualification only happens when more
than
one (different) property with a given name is defined within a given
hierarchy, since dynamic EMF cannot handle such "duplicate" properties.
This
may be improved once we introduce support for "static" profile
definition -
see bug 155535...

Kenn

"Andreas Maier" <maiera@xxxxxxxxxx> wrote in message
news:efrc5r$i2s$1@xxxxxxxxxxxxxxxxxxxx
James,
unfortunately it is neither a properly working single set of
properties,
nor two sets of properties :-( That's why I was asking in order to
understand what I see.

What I see is that out of the set of properties that should be there
twice
(as you confirmed), only one occurrence is shown. The property names of
that one occurence are nevertheless qualified with the package path
relative to the profile (which I assume is because there is some
recognition in the tool that the unqualified name alone would now be
ambiguous).

So for the example described below, for an association class AC1 to
which
CIM_Association is applied, the following single property is shown on
AC1:
TestProfile::CIM_Association::Abstract

when there should be two occurences of Abstract.

Second, the qualified name is unexpected to me even for that single
one,
because Abstract is not owned by stereotype CIM_Association, but by
CIM_Qualifier_Abstract. But I am just guessing here.

Third, now comes the reason why I said that the one set is not working
properly: In my larger CIM profile (which has an additional level of
inheritance compared to the test example discussed here), the
stereotype
properties on AC1 have suddenly become read-only for some reason. In my
smaller test profile, the properties are still modifiable as expected.

Andy


James Bruck wrote:
Hi Andreas,

You would expect to have 2 sets of properties. All the common
inherited
properties would be duplicated.    Is that not what you are seeing?

- James.



"Andreas Maier" <maiera@xxxxxxxxxx> wrote in message
news:efjk2g$qsr$1@xxxxxxxxxxxxxxxxxxxx

Hi,
I am using stereotype inheritance in order to have a single
definition of
  a stereotype representing a CIM qualifier (e.g.
CIM_Qualifier_Abstract). This stereotype is inherited into some other
stereotypes that are the ones that get applied to the elements of the
user model (in this case, CIM_Class extending classes and
CIM_Association
extending association classes).

In CIM, an association class is considered a kind of class (same as
in
UML). We want to also map that to our stereotypes, i.e.
CIM_Association
ideally should inherit from CIM_Class. On an association class, only
CIM_Association would be applied, and on a normal class, only
CIM_Class
would be applied.

If we concentrate on the association classes now:
CIM_Qualifier_Abstract
now arrives at CIM_Association both by inheriting it directly, and
again
by inheriting it indirectly through CIM_Class.

My question is: Should I expect to have one or two sets of properties
of
CIM_Qualifier_Abstract on association classes that have
CIM_Association
applied ?

Andy