Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Confusion about Generalization and Extensions of Stereotypes
Confusion about Generalization and Extensions of Stereotypes [message #477939] Thu, 06 November 2008 13:32 Go to next message
Jochen Wuttke is currently offline Jochen WuttkeFriend
Messages: 41
Registered: July 2009
Member
Hi,

I have a profile with a couple of stereotypes. I would like to apply a
given stereotype to classes as well as associations. To create my
profile I followed the steps in the tutorial that comes with Eclipse and
that got me to the point where I can apply the stereotype to classes.
Then I repeated the steps of creating an extension for uml:Association
and was expecting that I then would be able to apply the stereotype to
associations. That however doesn't work.

Now here's my question:
In the tutorial most stereotypes have "EStructuralFeature" as
Generalization, and then an "Extension" to the actual UML Metaclass the
stereotype should be applied to. What I'm not clear about is whether or
not the Generalizations have anything to do with the applicability of
stereotypes to model elements.


Thanks,
Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #477940 is a reply to message #477939] Thu, 06 November 2008 16:31 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Jochen,

You should be able to apply a stereotype to any UML element including
Generalization or Association.

When you say ".. that doesn't work" what exactly doesn't work. Are you
seeing errors?
Posting a snippet of your profile and/or model would be helpful.

Cheers,
- James.




"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:geurlv$856$1@build.eclipse.org...
> Hi,
>
> I have a profile with a couple of stereotypes. I would like to apply a
> given stereotype to classes as well as associations. To create my profile
> I followed the steps in the tutorial that comes with Eclipse and that got
> me to the point where I can apply the stereotype to classes. Then I
> repeated the steps of creating an extension for uml:Association and was
> expecting that I then would be able to apply the stereotype to
> associations. That however doesn't work.
>
> Now here's my question:
> In the tutorial most stereotypes have "EStructuralFeature" as
> Generalization, and then an "Extension" to the actual UML Metaclass the
> stereotype should be applied to. What I'm not clear about is whether or
> not the Generalizations have anything to do with the applicability of
> stereotypes to model elements.
>
>
> Thanks,
> Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #477941 is a reply to message #477939] Thu, 06 November 2008 16:37 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Jochen,

Generalizations between stereotypes aren't necessary, but may be useful if
you find that several steretypes shared the same tags. Generally speaking,
it's better to create the extensions on concrete stereotypes, e.g. on the
leaf stereotypes in a hierarchy.

After you created your new extension to Association, did you redefine your
profile? In order for it to work, you'll need to redefine the profile, which
effectively updates the Ecore metadata so that it knows that the stereotype
can now be applied to associations. Of course, if you already have the
profile applied to a package, you'll need to reapply the profile to pick up
the latest version...

Kenn

"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:geurlv$856$1@build.eclipse.org...
> Hi,
>
> I have a profile with a couple of stereotypes. I would like to apply a
> given stereotype to classes as well as associations. To create my profile
> I followed the steps in the tutorial that comes with Eclipse and that got
> me to the point where I can apply the stereotype to classes. Then I
> repeated the steps of creating an extension for uml:Association and was
> expecting that I then would be able to apply the stereotype to
> associations. That however doesn't work.
>
> Now here's my question:
> In the tutorial most stereotypes have "EStructuralFeature" as
> Generalization, and then an "Extension" to the actual UML Metaclass the
> stereotype should be applied to. What I'm not clear about is whether or
> not the Generalizations have anything to do with the applicability of
> stereotypes to model elements.
>
>
> Thanks,
> Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #477945 is a reply to message #477941] Fri, 07 November 2008 09:59 Go to previous messageGo to next message
Jochen Wuttke is currently offline Jochen WuttkeFriend
Messages: 41
Registered: July 2009
Member
Kenn Hussey wrote:
> Jochen,
>
> Generalizations between stereotypes aren't necessary, but may be useful if
> you find that several steretypes shared the same tags. Generally speaking,
> it's better to create the extensions on concrete stereotypes, e.g. on the
> leaf stereotypes in a hierarchy.
>
> After you created your new extension to Association, did you redefine your
> profile? In order for it to work, you'll need to redefine the profile, which
> effectively updates the Ecore metadata so that it knows that the stereotype
> can now be applied to associations. Of course, if you already have the
> profile applied to a package, you'll need to reapply the profile to pick up
> the latest version...

That was the problem, I didn't redefine the profile. This leads me to a
question about the general workflow while developing a profile.

I'm working on this project with a colleague and we are extending the
profile in different parts. When he adds something new to the profile,
he simply re-defines the profile without deleting the previous
"definition". That leads to multiple "definitions" showing up in the
editor and in the file. However, this has the advantage that the models
using older versions of the profile will continue working and you can
still use the new elements.
Instead, I always delete all old definitions and the define the profile.
However, that way the models don't work anymore, because all the
identifiers are different.
I would say my way of doing things is more tidy, but creates a lot of
overhead, because we have to update the model every time. So what is the
suggested or intended workflow? Or is there no such thing, because
profiles are usually developed once and then only used?

Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #477947 is a reply to message #477945] Fri, 07 November 2008 16:20 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Jochen,

The older definitions are kept intentionally to support migration of models
that may be using previous versions of the profile. Whether your application
needs to support this is up to you. I know some consumers of UML2 have
introduced additional metadata/signifiance to specific definitions (e.g. by
calling them "releases") and provided a "purge" utility to help users
compact profiles that have grown over the development cycle...

Kenn

"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:gf13ib$j49$1@build.eclipse.org...
> Kenn Hussey wrote:
>> Jochen,
>>
>> Generalizations between stereotypes aren't necessary, but may be useful
>> if you find that several steretypes shared the same tags. Generally
>> speaking, it's better to create the extensions on concrete stereotypes,
>> e.g. on the leaf stereotypes in a hierarchy.
>>
>> After you created your new extension to Association, did you redefine
>> your profile? In order for it to work, you'll need to redefine the
>> profile, which effectively updates the Ecore metadata so that it knows
>> that the stereotype can now be applied to associations. Of course, if you
>> already have the profile applied to a package, you'll need to reapply the
>> profile to pick up the latest version...
>
> That was the problem, I didn't redefine the profile. This leads me to a
> question about the general workflow while developing a profile.
>
> I'm working on this project with a colleague and we are extending the
> profile in different parts. When he adds something new to the profile, he
> simply re-defines the profile without deleting the previous "definition".
> That leads to multiple "definitions" showing up in the editor and in the
> file. However, this has the advantage that the models using older versions
> of the profile will continue working and you can still use the new
> elements.
> Instead, I always delete all old definitions and the define the profile.
> However, that way the models don't work anymore, because all the
> identifiers are different.
> I would say my way of doing things is more tidy, but creates a lot of
> overhead, because we have to update the model every time. So what is the
> suggested or intended workflow? Or is there no such thing, because
> profiles are usually developed once and then only used?
>
> Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #627149 is a reply to message #477939] Thu, 06 November 2008 16:31 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Jochen,

You should be able to apply a stereotype to any UML element including
Generalization or Association.

When you say ".. that doesn't work" what exactly doesn't work. Are you
seeing errors?
Posting a snippet of your profile and/or model would be helpful.

Cheers,
- James.




"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:geurlv$856$1@build.eclipse.org...
> Hi,
>
> I have a profile with a couple of stereotypes. I would like to apply a
> given stereotype to classes as well as associations. To create my profile
> I followed the steps in the tutorial that comes with Eclipse and that got
> me to the point where I can apply the stereotype to classes. Then I
> repeated the steps of creating an extension for uml:Association and was
> expecting that I then would be able to apply the stereotype to
> associations. That however doesn't work.
>
> Now here's my question:
> In the tutorial most stereotypes have "EStructuralFeature" as
> Generalization, and then an "Extension" to the actual UML Metaclass the
> stereotype should be applied to. What I'm not clear about is whether or
> not the Generalizations have anything to do with the applicability of
> stereotypes to model elements.
>
>
> Thanks,
> Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #627150 is a reply to message #477939] Thu, 06 November 2008 16:37 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Jochen,

Generalizations between stereotypes aren't necessary, but may be useful if
you find that several steretypes shared the same tags. Generally speaking,
it's better to create the extensions on concrete stereotypes, e.g. on the
leaf stereotypes in a hierarchy.

After you created your new extension to Association, did you redefine your
profile? In order for it to work, you'll need to redefine the profile, which
effectively updates the Ecore metadata so that it knows that the stereotype
can now be applied to associations. Of course, if you already have the
profile applied to a package, you'll need to reapply the profile to pick up
the latest version...

Kenn

"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:geurlv$856$1@build.eclipse.org...
> Hi,
>
> I have a profile with a couple of stereotypes. I would like to apply a
> given stereotype to classes as well as associations. To create my profile
> I followed the steps in the tutorial that comes with Eclipse and that got
> me to the point where I can apply the stereotype to classes. Then I
> repeated the steps of creating an extension for uml:Association and was
> expecting that I then would be able to apply the stereotype to
> associations. That however doesn't work.
>
> Now here's my question:
> In the tutorial most stereotypes have "EStructuralFeature" as
> Generalization, and then an "Extension" to the actual UML Metaclass the
> stereotype should be applied to. What I'm not clear about is whether or
> not the Generalizations have anything to do with the applicability of
> stereotypes to model elements.
>
>
> Thanks,
> Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #627154 is a reply to message #477941] Fri, 07 November 2008 09:59 Go to previous message
Jochen Wuttke is currently offline Jochen WuttkeFriend
Messages: 41
Registered: July 2009
Member
Kenn Hussey wrote:
> Jochen,
>
> Generalizations between stereotypes aren't necessary, but may be useful if
> you find that several steretypes shared the same tags. Generally speaking,
> it's better to create the extensions on concrete stereotypes, e.g. on the
> leaf stereotypes in a hierarchy.
>
> After you created your new extension to Association, did you redefine your
> profile? In order for it to work, you'll need to redefine the profile, which
> effectively updates the Ecore metadata so that it knows that the stereotype
> can now be applied to associations. Of course, if you already have the
> profile applied to a package, you'll need to reapply the profile to pick up
> the latest version...

That was the problem, I didn't redefine the profile. This leads me to a
question about the general workflow while developing a profile.

I'm working on this project with a colleague and we are extending the
profile in different parts. When he adds something new to the profile,
he simply re-defines the profile without deleting the previous
"definition". That leads to multiple "definitions" showing up in the
editor and in the file. However, this has the advantage that the models
using older versions of the profile will continue working and you can
still use the new elements.
Instead, I always delete all old definitions and the define the profile.
However, that way the models don't work anymore, because all the
identifiers are different.
I would say my way of doing things is more tidy, but creates a lot of
overhead, because we have to update the model every time. So what is the
suggested or intended workflow? Or is there no such thing, because
profiles are usually developed once and then only used?

Jochen
Re: Confusion about Generalization and Extensions of Stereotypes [message #627159 is a reply to message #477945] Fri, 07 November 2008 16:20 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Jochen,

The older definitions are kept intentionally to support migration of models
that may be using previous versions of the profile. Whether your application
needs to support this is up to you. I know some consumers of UML2 have
introduced additional metadata/signifiance to specific definitions (e.g. by
calling them "releases") and provided a "purge" utility to help users
compact profiles that have grown over the development cycle...

Kenn

"Jochen" <jochen.wuttke@gmx.de> wrote in message
news:gf13ib$j49$1@build.eclipse.org...
> Kenn Hussey wrote:
>> Jochen,
>>
>> Generalizations between stereotypes aren't necessary, but may be useful
>> if you find that several steretypes shared the same tags. Generally
>> speaking, it's better to create the extensions on concrete stereotypes,
>> e.g. on the leaf stereotypes in a hierarchy.
>>
>> After you created your new extension to Association, did you redefine
>> your profile? In order for it to work, you'll need to redefine the
>> profile, which effectively updates the Ecore metadata so that it knows
>> that the stereotype can now be applied to associations. Of course, if you
>> already have the profile applied to a package, you'll need to reapply the
>> profile to pick up the latest version...
>
> That was the problem, I didn't redefine the profile. This leads me to a
> question about the general workflow while developing a profile.
>
> I'm working on this project with a colleague and we are extending the
> profile in different parts. When he adds something new to the profile, he
> simply re-defines the profile without deleting the previous "definition".
> That leads to multiple "definitions" showing up in the editor and in the
> file. However, this has the advantage that the models using older versions
> of the profile will continue working and you can still use the new
> elements.
> Instead, I always delete all old definitions and the define the profile.
> However, that way the models don't work anymore, because all the
> identifiers are different.
> I would say my way of doing things is more tidy, but creates a lot of
> overhead, because we have to update the model every time. So what is the
> suggested or intended workflow? Or is there no such thing, because
> profiles are usually developed once and then only used?
>
> Jochen
Previous Topic:Signal-Reception and Method-Attribute
Next Topic:Dynamic Modeling Tutorial with EclipseUML 2008
Goto Forum:
  


Current Time: Fri Apr 19 20:06:13 GMT 2024

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

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

Back to the top