|
|
|
Re: Replacing UML2::NamedElement::isDistinguishableFrom with new operation i a profile? [message #470402 is a reply to message #470383] |
Tue, 13 February 2007 21:00 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Anders,
While the specification doesn't explicitly state that behavior cannot be
overridden by a profile, it does state that the purpose of a profile is to
constrain and/or extend a metamodel. The mechanism for overriding behavior
(and structure) in UML is redefinition, but since redefinition can only be
done in the context of generalization, and stereotypes can only specialize
stereotypes (not metaclasses), profiles effectively cannot be used to
redefine behavior in the metamodel...
Kenn
<user@domain.com> wrote in message news:45D16BC5.7040002@domain.com...
> Hi James,
>
> Sorry to hear this, It would have been super if possible. Ill have alook
> at the articles but unfortunately compliance is important in the use case.
>
> By any chance you dont know what, in the UML2 spec, that disallows
> compliant appl to redefine such queries in a profile? and where in the
> profiles chapter I can find these rules?
>
>
> thanks
> /anders
>
> James Bruck wrote:
>> Hi Anders,
>>
>> Unfortunately you cannot override such behavior in a profile. You
>> might want to consider some form of UML extension to accomplish this.
>>
>> Have a look at the draft form of the "Extending UML" articles here
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 .... They explain
>> the pros and cons of extending UML and explore some options you have at
>> your disposal.
>>
>> Regards,
>>
>> - James.
>>
>>
>> <user@domain.com> wrote in message news:eqg9mk$321$1@utils.eclipse.org...
>>> Hi,
>>>
>>> I got a use case where I need to replace the built in
>>> NamedElement::isDistinguishableFrom query with another customized query
>>> that also considers the NamedElement::type in the comparison.
>>>
>>> Is this possible to do with current UML2 implementation using a new
>>> profile where I define a new overriden/redefined operation
>>> isDistinguishableFrom() for a stereotype <<MyClass>> ?
>>>
>>>
>>> ----------------------------
>>> NamedElement::isDistinguishableFrom(n:NamedElement, ns: Namespace):
>>> Boolean;
>>> isDistinguishable =
>>> if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType)
>>> then
>>> ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))- >isEmpty()
>>> else true
>>> ---------------
>>>
>>>
>>> thanks
>>> /anders
>>>
>>>
>>
|
|
|
|
|
Re: Replacing UML2::NamedElement::isDistinguishableFrom with new operation i a profile? [message #588659 is a reply to message #470383] |
Tue, 13 February 2007 21:00 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Anders,
While the specification doesn't explicitly state that behavior cannot be
overridden by a profile, it does state that the purpose of a profile is to
constrain and/or extend a metamodel. The mechanism for overriding behavior
(and structure) in UML is redefinition, but since redefinition can only be
done in the context of generalization, and stereotypes can only specialize
stereotypes (not metaclasses), profiles effectively cannot be used to
redefine behavior in the metamodel...
Kenn
<user@domain.com> wrote in message news:45D16BC5.7040002@domain.com...
> Hi James,
>
> Sorry to hear this, It would have been super if possible. Ill have alook
> at the articles but unfortunately compliance is important in the use case.
>
> By any chance you dont know what, in the UML2 spec, that disallows
> compliant appl to redefine such queries in a profile? and where in the
> profiles chapter I can find these rules?
>
>
> thanks
> /anders
>
> James Bruck wrote:
>> Hi Anders,
>>
>> Unfortunately you cannot override such behavior in a profile. You
>> might want to consider some form of UML extension to accomplish this.
>>
>> Have a look at the draft form of the "Extending UML" articles here
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=77413 .... They explain
>> the pros and cons of extending UML and explore some options you have at
>> your disposal.
>>
>> Regards,
>>
>> - James.
>>
>>
>> <user@domain.com> wrote in message news:eqg9mk$321$1@utils.eclipse.org...
>>> Hi,
>>>
>>> I got a use case where I need to replace the built in
>>> NamedElement::isDistinguishableFrom query with another customized query
>>> that also considers the NamedElement::type in the comparison.
>>>
>>> Is this possible to do with current UML2 implementation using a new
>>> profile where I define a new overriden/redefined operation
>>> isDistinguishableFrom() for a stereotype <<MyClass>> ?
>>>
>>>
>>> ----------------------------
>>> NamedElement::isDistinguishableFrom(n:NamedElement, ns: Namespace):
>>> Boolean;
>>> isDistinguishable =
>>> if self.oclIsKindOf(n.oclType) or n.oclIsKindOf(self.oclType)
>>> then
>>> ns.getNamesOfMember(self)->intersection(ns.getNamesOfMember(n))- >isEmpty()
>>> else true
>>> ---------------
>>>
>>>
>>> thanks
>>> /anders
>>>
>>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03837 seconds