Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Replacing UML2::NamedElement::isDistinguishableFrom with new operation i a profile?
Replacing UML2::NamedElement::isDistinguishableFrom with new operation i a profile? [message #470224] Thu, 08 February 2007 22:54 Go to next message
user is currently offline userFriend
Messages: 296
Registered: July 2009
Senior Member
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 #470226 is a reply to message #470224] Fri, 09 February 2007 03:33 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
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 #470383 is a reply to message #470226] Tue, 13 February 2007 07:41 Go to previous messageGo to next message
user is currently offline userFriend
Messages: 296
Registered: July 2009
Senior Member
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 #470402 is a reply to message #470383] Tue, 13 February 2007 21:00 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
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 #586721 is a reply to message #470224] Fri, 09 February 2007 03:33 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
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 #588584 is a reply to message #470226] Tue, 13 February 2007 07:41 Go to previous message
user is currently offline userFriend
Messages: 296
Registered: July 2009
Senior Member
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 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
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
>>>
>>>
>>
Previous Topic:type conformance
Next Topic:Re: ConcurrentModificationExceptions with ECoreUtil.resolveAll
Goto Forum:
  


Current Time: Mon Apr 06 19:08:32 GMT 2020

Powered by FUDForum. Page generated in 0.10672 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top