Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype con
A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype con [message #473120] Thu, 07 June 2007 18:35 Go to next message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 135
Registered: July 2009
Senior Member
Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
that extends uml:Class.

The following OCL snippet seems to determine whether the application of
the 'Shaddock' profile was strict or not.

self.base_Class.getModel().getAllProfileApplications()->exists
(pa:ProfileApplication
| pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)

If I have N stereotypes that need to know ProfileApplication.isStrict
and they are instantiated on average M times, then I'll have N*M
expensive queries whenever I do full-scale validation.

Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
UML/OCL implementation in Eclipse 3.2 which doesn't have support for
derived values. With derived values, I know -- at least in principle --
how to solve this problem better. Without derived values, I don't know
how to solve this problem without paying the O(N*M) complexity tax.

-- Nicolas.
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #473121 is a reply to message #473120] Thu, 07 June 2007 19:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nicolas,

If the Shaddock profile defines this stereotype, then just do:

self.getProfile().isStrict

HTH,

Christian


Nicolas Rouquette wrote:

> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
> that extends uml:Class.
>
> The following OCL snippet seems to determine whether the application of
> the 'Shaddock' profile was strict or not.
>
> self.base_Class.getModel().getAllProfileApplications()->exists
> (pa:ProfileApplication
> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>
> If I have N stereotypes that need to know ProfileApplication.isStrict
> and they are instantiated on average M times, then I'll have N*M
> expensive queries whenever I do full-scale validation.
>
> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
> derived values. With derived values, I know -- at least in principle --
> how to solve this problem better. Without derived values, I don't know
> how to solve this problem without paying the O(N*M) complexity tax.
>
> -- Nicolas.
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #473127 is a reply to message #473121] Fri, 08 June 2007 13:29 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1618
Registered: July 2009
Senior Member
Ah, but it's the _application_ of the profile that is strict or not.
Nicolas, how are you using this information in your application? Typically
the strictness of a profile application is used by a tool to limit the set
of metaclasses available in the the tool the the ones that are referenced
from the profile...

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f49mhf$j8r$1@build.eclipse.org...
> Hi, Nicolas,
>
> If the Shaddock profile defines this stereotype, then just do:
>
> self.getProfile().isStrict
>
> HTH,
>
> Christian
>
>
> Nicolas Rouquette wrote:
>
>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>> that extends uml:Class.
>>
>> The following OCL snippet seems to determine whether the application of
>> the 'Shaddock' profile was strict or not.
>>
>> self.base_Class.getModel().getAllProfileApplications()->exists
>> (pa:ProfileApplication
>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>
>> If I have N stereotypes that need to know ProfileApplication.isStrict
>> and they are instantiated on average M times, then I'll have N*M
>> expensive queries whenever I do full-scale validation.
>>
>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>> derived values. With derived values, I know -- at least in principle --
>> how to solve this problem better. Without derived values, I don't know
>> how to solve this problem without paying the O(N*M) complexity tax.
>>
>> -- Nicolas.
>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #473128 is a reply to message #473127] Fri, 08 June 2007 13:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Doh!

In that case, the proper OCL would be

self.getProfile().profileApplication->forAll(isStrict)

Of course, this would require that MDT OCL support navigation of unnamed
association ends. It currently supports navigation of non-navigable ends,
but only if they are explicitly named.

This would be a good enhancement request for OCL 1.2 (hint).

Cheers,

Christian


Kenn Hussey wrote:

> Ah, but it's the _application_ of the profile that is strict or not.
> Nicolas, how are you using this information in your application? Typically
> the strictness of a profile application is used by a tool to limit the set
> of metaclasses available in the the tool the the ones that are referenced
> from the profile...
>
> Kenn
>
> "Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
> news:f49mhf$j8r$1@build.eclipse.org...
>> Hi, Nicolas,
>>
>> If the Shaddock profile defines this stereotype, then just do:
>>
>> self.getProfile().isStrict
>>
>> HTH,
>>
>> Christian
>>
>>
>> Nicolas Rouquette wrote:
>>
>>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>>> that extends uml:Class.
>>>
>>> The following OCL snippet seems to determine whether the application of
>>> the 'Shaddock' profile was strict or not.
>>>
>>> self.base_Class.getModel().getAllProfileApplications()->exists
>>> (pa:ProfileApplication
>>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>>
>>> If I have N stereotypes that need to know ProfileApplication.isStrict
>>> and they are instantiated on average M times, then I'll have N*M
>>> expensive queries whenever I do full-scale validation.
>>>
>>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>>> derived values. With derived values, I know -- at least in principle --
>>> how to solve this problem better. Without derived values, I don't know
>>> how to solve this problem without paying the O(N*M) complexity tax.
>>>
>>> -- Nicolas.
>>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #473171 is a reply to message #473128] Mon, 11 June 2007 18:35 Go to previous messageGo to next message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 135
Registered: July 2009
Senior Member
See below for responses to Christian & Kenn.

Christian W. Damus wrote:

> Doh!
>
> In that case, the proper OCL would be
>
> self.getProfile().profileApplication->forAll(isStrict)
>
> Of course, this would require that MDT OCL support navigation of unnamed
> association ends. It currently supports navigation of non-navigable ends,
> but only if they are explicitly named.

Can you please confirm that you are referring to two associations in
org.eclipse.uml2.uml.resources/metamodels/UML.metamodel.uml, which,
in terms of the UML 2.1.1 spec (formal/2007-02-05) mean:

1) 'A_ownedStereotype_profile'
per '/ownedStereotype' in 18.3.6, p. 657

2) 'A_profileApplication_applyingPackage'
per 'applyingPackage' in 18.3.7, p. 664

> This would be a good enhancement request for OCL 1.2 (hint).

If I grokked this right, I can write this enhancement request.

> Cheers,
>
> Christian
>
>
> Kenn Hussey wrote:
>
>> Ah, but it's the _application_ of the profile that is strict or not.
>> Nicolas, how are you using this information in your application? Typically
>> the strictness of a profile application is used by a tool to limit the set
>> of metaclasses available in the the tool the the ones that are referenced
>> from the profile...

I am working with 3 profiles that define sub-languages of the UML: P1,
P2, P3.

P1 is the smallest sub-language.
P2 extends P1 (i.e., P1 is applied to P2)
P3 extends P1 and P2 (i.e., P1 and P2 are applied to P3)

A constraint Ci in a profile Pj can have two kinds of semantic roles:

- a "closed-world semantics" to ensure that a <<Pj>>-profiled instance
model is properly contained within the Pj sub-language of the UML.

- an "open-world semantics" that allows a <<Pj>>-profiled instance model
to be properly contained in a language L with the constraint that the Pj
sub-language of the UML must be a proper subset of L.

My convention is to associate a "strict" profile application to mean
that the applied profile has "closed-world semantics" and a "non-strict"
profile application mean that the applied profile has "open-world
semantics" for the model.

This seems to work fine except that the cost of checking strict vs.
non-strict profile application could be very expensive for large
instance models and/or large numbers of constraints with "closed-world
semantics".

Cheers,
-- Nicolas.


>> Kenn
>>
>> "Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
>> news:f49mhf$j8r$1@build.eclipse.org...
>>> Hi, Nicolas,
>>>
>>> If the Shaddock profile defines this stereotype, then just do:
>>>
>>> self.getProfile().isStrict
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>>
>>> Nicolas Rouquette wrote:
>>>
>>>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>>>> that extends uml:Class.
>>>>
>>>> The following OCL snippet seems to determine whether the application of
>>>> the 'Shaddock' profile was strict or not.
>>>>
>>>> self.base_Class.getModel().getAllProfileApplications()->exists
>>>> (pa:ProfileApplication
>>>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>>>
>>>> If I have N stereotypes that need to know ProfileApplication.isStrict
>>>> and they are instantiated on average M times, then I'll have N*M
>>>> expensive queries whenever I do full-scale validation.
>>>>
>>>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>>>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>>>> derived values. With derived values, I know -- at least in principle --
>>>> how to solve this problem better. Without derived values, I don't know
>>>> how to solve this problem without paying the O(N*M) complexity tax.
>>>>
>>>> -- Nicolas.
>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #473172 is a reply to message #473171] Mon, 11 June 2007 18:56 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nicolas,

See some replies in-line, below.

Cheers,

Christian

Nicolas Rouquette wrote:

> See below for responses to Christian & Kenn.
>
> Christian W. Damus wrote:
>
>> Doh!
>>
>> In that case, the proper OCL would be
>>
>> self.getProfile().profileApplication->forAll(isStrict)
>>
>> Of course, this would require that MDT OCL support navigation of unnamed
>> association ends. It currently supports navigation of non-navigable
>> ends, but only if they are explicitly named.
>
> Can you please confirm that you are referring to two associations in
> org.eclipse.uml2.uml.resources/metamodels/UML.metamodel.uml, which,
> in terms of the UML 2.1.1 spec (formal/2007-02-05) mean:
>
> 1) 'A_ownedStereotype_profile'
> per '/ownedStereotype' in 18.3.6, p. 657
>
> 2) 'A_profileApplication_applyingPackage'
> per 'applyingPackage' in 18.3.7, p. 664

I mean the owned end of A_profileApplication_appliedProfile, the end that is
opposite to the ProfileApplication::appliedProfile attribute.


>> This would be a good enhancement request for OCL 1.2 (hint).
>
> If I grokked this right, I can write this enhancement request.

Yes, anybody can request an enhancement, like this:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT& bug_severity=enhancement&component=OCL&version=1.1.0


>> Cheers,
>>
>> Christian
>>
>>

<snip>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #619906 is a reply to message #473120] Thu, 07 June 2007 19:33 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nicolas,

If the Shaddock profile defines this stereotype, then just do:

self.getProfile().isStrict

HTH,

Christian


Nicolas Rouquette wrote:

> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
> that extends uml:Class.
>
> The following OCL snippet seems to determine whether the application of
> the 'Shaddock' profile was strict or not.
>
> self.base_Class.getModel().getAllProfileApplications()->exists
> (pa:ProfileApplication
> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>
> If I have N stereotypes that need to know ProfileApplication.isStrict
> and they are instantiated on average M times, then I'll have N*M
> expensive queries whenever I do full-scale validation.
>
> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
> derived values. With derived values, I know -- at least in principle --
> how to solve this problem better. Without derived values, I don't know
> how to solve this problem without paying the O(N*M) complexity tax.
>
> -- Nicolas.
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #619915 is a reply to message #473121] Fri, 08 June 2007 13:29 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1618
Registered: July 2009
Senior Member
Ah, but it's the _application_ of the profile that is strict or not.
Nicolas, how are you using this information in your application? Typically
the strictness of a profile application is used by a tool to limit the set
of metaclasses available in the the tool the the ones that are referenced
from the profile...

Kenn

"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:f49mhf$j8r$1@build.eclipse.org...
> Hi, Nicolas,
>
> If the Shaddock profile defines this stereotype, then just do:
>
> self.getProfile().isStrict
>
> HTH,
>
> Christian
>
>
> Nicolas Rouquette wrote:
>
>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>> that extends uml:Class.
>>
>> The following OCL snippet seems to determine whether the application of
>> the 'Shaddock' profile was strict or not.
>>
>> self.base_Class.getModel().getAllProfileApplications()->exists
>> (pa:ProfileApplication
>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>
>> If I have N stereotypes that need to know ProfileApplication.isStrict
>> and they are instantiated on average M times, then I'll have N*M
>> expensive queries whenever I do full-scale validation.
>>
>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>> derived values. With derived values, I know -- at least in principle --
>> how to solve this problem better. Without derived values, I don't know
>> how to solve this problem without paying the O(N*M) complexity tax.
>>
>> -- Nicolas.
>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #619916 is a reply to message #473127] Fri, 08 June 2007 13:38 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Doh!

In that case, the proper OCL would be

self.getProfile().profileApplication->forAll(isStrict)

Of course, this would require that MDT OCL support navigation of unnamed
association ends. It currently supports navigation of non-navigable ends,
but only if they are explicitly named.

This would be a good enhancement request for OCL 1.2 (hint).

Cheers,

Christian


Kenn Hussey wrote:

> Ah, but it's the _application_ of the profile that is strict or not.
> Nicolas, how are you using this information in your application? Typically
> the strictness of a profile application is used by a tool to limit the set
> of metaclasses available in the the tool the the ones that are referenced
> from the profile...
>
> Kenn
>
> "Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
> news:f49mhf$j8r$1@build.eclipse.org...
>> Hi, Nicolas,
>>
>> If the Shaddock profile defines this stereotype, then just do:
>>
>> self.getProfile().isStrict
>>
>> HTH,
>>
>> Christian
>>
>>
>> Nicolas Rouquette wrote:
>>
>>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>>> that extends uml:Class.
>>>
>>> The following OCL snippet seems to determine whether the application of
>>> the 'Shaddock' profile was strict or not.
>>>
>>> self.base_Class.getModel().getAllProfileApplications()->exists
>>> (pa:ProfileApplication
>>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>>
>>> If I have N stereotypes that need to know ProfileApplication.isStrict
>>> and they are instantiated on average M times, then I'll have N*M
>>> expensive queries whenever I do full-scale validation.
>>>
>>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>>> derived values. With derived values, I know -- at least in principle --
>>> how to solve this problem better. Without derived values, I don't know
>>> how to solve this problem without paying the O(N*M) complexity tax.
>>>
>>> -- Nicolas.
>>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #619981 is a reply to message #473128] Mon, 11 June 2007 18:35 Go to previous message
Nicolas Rouquette is currently offline Nicolas RouquetteFriend
Messages: 135
Registered: July 2009
Senior Member
See below for responses to Christian & Kenn.

Christian W. Damus wrote:

> Doh!
>
> In that case, the proper OCL would be
>
> self.getProfile().profileApplication->forAll(isStrict)
>
> Of course, this would require that MDT OCL support navigation of unnamed
> association ends. It currently supports navigation of non-navigable ends,
> but only if they are explicitly named.

Can you please confirm that you are referring to two associations in
org.eclipse.uml2.uml.resources/metamodels/UML.metamodel.uml, which,
in terms of the UML 2.1.1 spec (formal/2007-02-05) mean:

1) 'A_ownedStereotype_profile'
per '/ownedStereotype' in 18.3.6, p. 657

2) 'A_profileApplication_applyingPackage'
per 'applyingPackage' in 18.3.7, p. 664

> This would be a good enhancement request for OCL 1.2 (hint).

If I grokked this right, I can write this enhancement request.

> Cheers,
>
> Christian
>
>
> Kenn Hussey wrote:
>
>> Ah, but it's the _application_ of the profile that is strict or not.
>> Nicolas, how are you using this information in your application? Typically
>> the strictness of a profile application is used by a tool to limit the set
>> of metaclasses available in the the tool the the ones that are referenced
>> from the profile...

I am working with 3 profiles that define sub-languages of the UML: P1,
P2, P3.

P1 is the smallest sub-language.
P2 extends P1 (i.e., P1 is applied to P2)
P3 extends P1 and P2 (i.e., P1 and P2 are applied to P3)

A constraint Ci in a profile Pj can have two kinds of semantic roles:

- a "closed-world semantics" to ensure that a <<Pj>>-profiled instance
model is properly contained within the Pj sub-language of the UML.

- an "open-world semantics" that allows a <<Pj>>-profiled instance model
to be properly contained in a language L with the constraint that the Pj
sub-language of the UML must be a proper subset of L.

My convention is to associate a "strict" profile application to mean
that the applied profile has "closed-world semantics" and a "non-strict"
profile application mean that the applied profile has "open-world
semantics" for the model.

This seems to work fine except that the cost of checking strict vs.
non-strict profile application could be very expensive for large
instance models and/or large numbers of constraints with "closed-world
semantics".

Cheers,
-- Nicolas.


>> Kenn
>>
>> "Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
>> news:f49mhf$j8r$1@build.eclipse.org...
>>> Hi, Nicolas,
>>>
>>> If the Shaddock profile defines this stereotype, then just do:
>>>
>>> self.getProfile().isStrict
>>>
>>> HTH,
>>>
>>> Christian
>>>
>>>
>>> Nicolas Rouquette wrote:
>>>
>>>> Suppose a fictitious UML profile called 'Shaddock' defines a stereotype
>>>> that extends uml:Class.
>>>>
>>>> The following OCL snippet seems to determine whether the application of
>>>> the 'Shaddock' profile was strict or not.
>>>>
>>>> self.base_Class.getModel().getAllProfileApplications()->exists
>>>> (pa:ProfileApplication
>>>> | pa.appliedProfile.getLabel() = 'Shaddock' and pa.isStrict)
>>>>
>>>> If I have N stereotypes that need to know ProfileApplication.isStrict
>>>> and they are instantiated on average M times, then I'll have N*M
>>>> expensive queries whenever I do full-scale validation.
>>>>
>>>> Since I am using RSA 7.0.0.2, I'm bound to the limitations of the
>>>> UML/OCL implementation in Eclipse 3.2 which doesn't have support for
>>>> derived values. With derived values, I know -- at least in principle --
>>>> how to solve this problem better. Without derived values, I don't know
>>>> how to solve this problem without paying the O(N*M) complexity tax.
>>>>
>>>> -- Nicolas.
>
Re: A better/cleaner way to determine ProfileApplication.isStrict within the context of a stereotype [message #619983 is a reply to message #473171] Mon, 11 June 2007 18:56 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Nicolas,

See some replies in-line, below.

Cheers,

Christian

Nicolas Rouquette wrote:

> See below for responses to Christian & Kenn.
>
> Christian W. Damus wrote:
>
>> Doh!
>>
>> In that case, the proper OCL would be
>>
>> self.getProfile().profileApplication->forAll(isStrict)
>>
>> Of course, this would require that MDT OCL support navigation of unnamed
>> association ends. It currently supports navigation of non-navigable
>> ends, but only if they are explicitly named.
>
> Can you please confirm that you are referring to two associations in
> org.eclipse.uml2.uml.resources/metamodels/UML.metamodel.uml, which,
> in terms of the UML 2.1.1 spec (formal/2007-02-05) mean:
>
> 1) 'A_ownedStereotype_profile'
> per '/ownedStereotype' in 18.3.6, p. 657
>
> 2) 'A_profileApplication_applyingPackage'
> per 'applyingPackage' in 18.3.7, p. 664

I mean the owned end of A_profileApplication_appliedProfile, the end that is
opposite to the ProfileApplication::appliedProfile attribute.


>> This would be a good enhancement request for OCL 1.2 (hint).
>
> If I grokked this right, I can write this enhancement request.

Yes, anybody can request an enhancement, like this:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MDT& bug_severity=enhancement&component=OCL&version=1.1.0


>> Cheers,
>>
>> Christian
>>
>>

<snip>
Previous Topic:Determine accessible Types
Next Topic:How can I get XMI ID of model elements?
Goto Forum:
  


Current Time: Thu Dec 18 00:47:37 GMT 2014

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

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