|
|
|
Re: Overriding Stereotype's properties and assigning them a value [message #1066697 is a reply to message #1066685] |
Wed, 03 July 2013 19:44 |
Matteo M. Messages: 40 Registered: May 2012 |
Member |
|
|
Hi,
Ed Willink wrote on Wed, 03 July 2013 13:53
On 03/07/2013 17:59, Camille Letavernier wrote:
> Moreover, the concept of "Redefined" does not exist in Ecore. I
> suspect that you won't be able to achieve what you're trying to do at
> all.
...
There certainly is some support for redefinition.
Yes, there is. It works if you set the type of isSerial in HwSerialBus (the derived stereotype) to Boolean instead of NFP_Boolean (like the base stereotype). I attached the dummy profile and the dummy model with a correctly stereotyped Block to this thread. However you also have to leave unset the read-only attribute (read-only = false) otherwise it won't work...
I was making use of the "trick" of setting a read-only default value (true) for isSerial in HwSerialBus so as to constrain an attribute of the base stereotype to a fixed value in the derived stereotype. So, now, the question is: when defining a derived stereotype, how do I constrain to a given value an attribute that I inherit from a base stereotype?
--
Matteo
[Updated on: Wed, 03 July 2013 19:46] Report message to a moderator
|
|
|
Re: Overriding Stereotype's properties and assigning them a value [message #1066723 is a reply to message #1066685] |
Thu, 04 July 2013 05:48 |
Marc-Florian Wendland Messages: 83 Registered: January 2013 |
Member |
|
|
Ed,
I mean this is related to the language in which Ecore is implemented.
Redefinition (in CMOF) allows you to get completely rid of a
RedefinableElement in a specialized class. This does not work in Java at
all. Redefinition works fine in UML2 if the redefining element and the
redefined element have different names. Then, the access to the redefined
element (e.g., a feature) delegates the request to the redefining element.
That works quite nice.
Even UML2 has not solved this technology-related issue properly. For
example, have a look at DurationConstraint, whose association end
specification redefines the one inherited by Constraint. In fact,
DurationConstraint::specification refers to a DurationInterval (in the spec)
whereas the UML2 implementation still refers to ValueSpecification (which is
the class Constraint::specification is referring to). So, redefinition in
UML2 does not work properly if the names are identical.
Regards,
Marc-Florian
"Ed Willink" wrote in message news:kr1ofo$dc5$1@xxxxxxxxe.org...
Hi
On 03/07/2013 17:59, Camille Letavernier wrote:
> Moreover, the concept of "Redefined" does not exist in Ecore. I suspect
> that you won't be able to achieve what you're trying to do at all.
There is a lot of magic (to me) in the way that the MDT/UML2 support
succeeds in doing things for UML users that are not permitted in Ecore.
There certainly is some support for redefinition.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.03746 seconds