Generic type for applied stereotypes [message #1478243] |
Tue, 18 November 2014 14:10 |
Yves BERNARD Messages: 152 Registered: July 2014 |
Senior Member |
|
|
Hello,
Except if I missed something, with the last version of OCL it is no more possible to use the result of getStereotypeApplications() as a set of generic EObject.
I can cast a stereotype application to the proper stereotype and then use it as an instance of this stereotype. However, I cannot find a means to deal with any stereotype application in a generic maner, for instance for a document generation purpose.
Is there a common ancestor to any specific stereotype application that could be use as a type in an OCL query in order to provide this genericity?
Thanks for your help,
Yves
Context:
Eclipse Luna SR1
OCL v5.0.2
Eclipse UML2 v5.0.0
Yves
|
|
|
Re: Generic type for applied stereotypes [message #1478266 is a reply to message #1478243] |
Tue, 18 November 2014 14:36 |
|
Hi, Yves,
If your stereotypes all define some common set of features, then do
they not inherit those features already from a common ancestor
stereotype or class? Or perhaps you can define such a common ancestor
in your profiles.
Cheers,
Christian
On 2014-11-18 14:10:54 +0000, Yves BERNARD said:
> Hello,
>
> Except if I missed something, with the last version of OCL it is no
> more possible to use the result of getStereotypeApplications() as a set
> of generic EObject.
>
> I can cast a stereotype application to the proper stereotype and then
> use it as an instance of this stereotype. However, I cannot find a
> means to deal with any stereotype application in a generic maner, for
> instance for a document generation purpose.
>
> Is there a common ancestor to any specific stereotype application that
> could be use as a type in an OCL query in order to provide this
> genericity?
>
> Thanks for your help,
>
> Yves
> Context: Eclipse Luna SR1
> OCL v5.0.2
> Eclipse UML2 v5.0.0
|
|
|
Re: Generic type for applied stereotypes [message #1478570 is a reply to message #1478243] |
Tue, 18 November 2014 20:04 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi
If you are working within Papyrus, you are probably using the new Pivot
OCL prototype for OCL 2.5. This has typesafe navigation of stereotypes
so you should never need to use getStereotypeApplications(), but you can.
Use base_xxx and extension_xxx.
You also have reflection via oclType() and oclContainer(),
oclContents(). But no oclGet().
Regards
Ed Willink
On 18/11/2014 14:10, Yves BERNARD wrote:
> Hello,
>
> Except if I missed something, with the last version of OCL it is no more
> possible to use the result of getStereotypeApplications() as a set of
> generic EObject.
>
> I can cast a stereotype application to the proper stereotype and then
> use it as an instance of this stereotype. However, I cannot find a means
> to deal with any stereotype application in a generic maner, for instance
> for a document generation purpose.
>
> Is there a common ancestor to any specific stereotype application that
> could be use as a type in an OCL query in order to provide this genericity?
>
> Thanks for your help,
>
> Yves
> Context: Eclipse Luna SR1
> OCL v5.0.2
> Eclipse UML2 v5.0.0
>
>
|
|
|
Re: Generic type for applied stereotypes [message #1479167 is a reply to message #1478570] |
Wed, 19 November 2014 07:55 |
Yves BERNARD Messages: 152 Registered: July 2014 |
Senior Member |
|
|
Hi Christian,
You missed my point. The need is to be able to deal with any stereotype definition on a generic way. For instance, assume you want to generate a document for virtually any UML model listing, for each model element, what are the stereotypes applied and what are the values assigned to their "tag values", if any.
Hi Ed,
Yes, I think this is the version I used (formally: OCL v5.0.2). The point is that I cannot use base_xxx and extension_xxx since stereotype are not known a priori. I think I miss something like "oclGet()".
Do you see any workaround?
Thanks to both of you.
Yves
Yves
|
|
|
Powered by
FUDForum. Page generated in 0.83156 seconds