Bug 535456 - UML should not allow to apply 2 stereotypes on the same elements, when one is a generalization of the other.
Summary: UML should not allow to apply 2 stereotypes on the same elements, when one is...
Status: CLOSED INVALID
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: UML2 Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks: 435276
  Show dependency tree
 
Reported: 2018-06-01 10:13 EDT by Vincent Lorenzo CLA
Modified: 2018-06-07 04:35 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lorenzo CLA 2018-06-01 10:13:59 EDT
Steps to reproduce : 
   1. Create a stereotype ste1 extending UML::Element with a property prop1
   2. Create a stereotype ste2 as a generalization of ste1.
       -> the API and the UML editors allow to apply ste1 and ste2 in the same time on a given element.

This behavior must be forbidden, because ste2 is a ste1 and UML doesn't allow to apply several time the same stereotype on a given object. 

Moreover, the properties owned by ste1 also exist in ste2, so we get the propertier twice, with the same semantic and potentially with inconsistant values.
Comment 1 Kenn Hussey CLA 2018-06-01 10:34:07 EDT
Thanks for the bug report, contributions are most welcome.
Comment 2 Ed Willink CLA 2018-06-01 10:38:33 EDT
I think you need to find the UML 2.5 specification text that prohibits this. I think it is very legal.

Specifically whether a stereotype can be applied multiple times is a user modeling choice controlled by the extension multiplicity.

Even with a unit multiplicity, it is not forbidden since the user may choose to apply ste1 or ste2 or nothing.

There is no problem at compile time since that only involves references.

At run-time it is arguable that the multiple inheritances are merged, so that there is only one slot. Alternatively they could be distinct requiring disambiguation by the derived class name. Perhaps both designs are valid as in C++ where "virtual" chooses between the two policies. Perhaps in UML it is an implementation choice for which there could be a UML2Ecore GenOption.

=> INVALID IMHO
Comment 3 Patrick Tessier CLA 2018-06-07 04:35:06 EDT
After discussing withe the team. The norm do not forbid the application of two stererotypes that inherits  from the other.