Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Performance question:Extending the UML metamodel vs Using stereotypes & profiles
Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #478537] Tue, 23 June 2009 08:04 Go to next message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello,

I need to extend the UML2 metamodel and I have 2 options:
1) use the "lightweight" approach (i.e. create a profile with stereotypes)
2) use the "mediumweight" approach (i.e. define a new metamodel file and
extend some metaclasses from the UML metamodel + generate them using the
EMF/UML2 codegen mechanism).

Looking through the stereotype mechanism that is implemented in the
Element class (getStereotypeApplication(), ...) I would say that methods
like getValue(Stereotype) and setValue(Stereotype) are a little bit time
consuming (+ the fact that Dynamic EMF Objects are used).

As my algorithm uses the information stored in the extensions quite
extensively, I am wondering if it wouldn't be wiser to use the 2nd
approach instead of the first one?

Any advice would be appreciated.

Thanks.
Cristi.
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #478538 is a reply to message #478537] Tue, 23 June 2009 08:24 Go to previous messageGo to next message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Hi Cristi,

I would say you have three options:
- very light option is to add directly keywords on the needed UML
metamodel element (e.g. I mean on the UML Superstructure)
- medium is to use a profile and within this profile to define stereotype.
Don't forget that the profile is only a project mechanism and a profile
should be added for each modeling project/
- advanced is to use EMF/UML codegen mechanism

We are using the light (e.g keywords) and medium (e.g. stereotype within a
profile) and don't have any performance problem. I like keywords option
because this is really easy. If your purpose is to extend UML in order to
cover DSL then profile is a better option for my point of view.
If you want to create your DSL by creating a new model which is not
related to the UML Superstructure then I thin this is not the right
approach. You can use the UML superstructure and add stereotype and there
is no real need to create a new model superstructure which would be
specific.

Your performance problem is not related to EclipseUML2 or EMF but only to
the way you use it. My recommendation would be to keep your project
modeling extensions simple and to have as few as possible transformation
stages.

Vlad
Omondo
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #478539 is a reply to message #478538] Tue, 23 June 2009 09:38 Go to previous messageGo to next message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Vlad,

And thank you for your answer.

Actually in our project, we use both mechanisms (medium and advanced
according to your terminology). We needed to add some new metaclasses that
are not related to the UML elements, so we created a metamodel extension
(so we have the code generation loop already).

As for the Profile/Stereotypes, we use it to store some additional
information for Packages, Classes, Properties, etc. We access this
additional information (read/write) quite often in our algorithm (code
generation), where every additional operation has an important impact on
the whole execution time.

And the question is if for the above case it's worth to use the metamodel
approach instead of the stereotype based one. So from an architectural
point of view we are very comfortable with the current implementation, but
I think that when running our complex code generation algorithm the
metamodel approach would improve performance.

Best regards,
Cristi.


Vlad Varnica wrote:

> Hi Cristi,

> I would say you have three options:
> - very light option is to add directly keywords on the needed UML
> metamodel element (e.g. I mean on the UML Superstructure)
> - medium is to use a profile and within this profile to define stereotype.
> Don't forget that the profile is only a project mechanism and a profile
> should be added for each modeling project/
> - advanced is to use EMF/UML codegen mechanism

> We are using the light (e.g keywords) and medium (e.g. stereotype within a
> profile) and don't have any performance problem. I like keywords option
> because this is really easy. If your purpose is to extend UML in order to
> cover DSL then profile is a better option for my point of view.
> If you want to create your DSL by creating a new model which is not
> related to the UML Superstructure then I thin this is not the right
> approach. You can use the UML superstructure and add stereotype and there
> is no real need to create a new model superstructure which would be
> specific.

> Your performance problem is not related to EclipseUML2 or EMF but only to
> the way you use it. My recommendation would be to keep your project
> modeling extensions simple and to have as few as possible transformation
> stages.

> Vlad
> Omondo
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #478546 is a reply to message #478539] Wed, 24 June 2009 18:24 Go to previous messageGo to next message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Cristian,

Have you tried defining your profiles statically? That will give you an
API to work with your profile elements and also provides the ability to
support things like derived stereotype attributes, etc..

Kenn

Cristian wrote:
> Hello Vlad,
>
> And thank you for your answer.
>
> Actually in our project, we use both mechanisms (medium and advanced
> according to your terminology). We needed to add some new metaclasses
> that are not related to the UML elements, so we created a metamodel
> extension (so we have the code generation loop already).
>
> As for the Profile/Stereotypes, we use it to store some additional
> information for Packages, Classes, Properties, etc. We access this
> additional information (read/write) quite often in our algorithm (code
> generation), where every additional operation has an important impact on
> the whole execution time.
>
> And the question is if for the above case it's worth to use the
> metamodel approach instead of the stereotype based one. So from an
> architectural point of view we are very comfortable with the current
> implementation, but I think that when running our complex code
> generation algorithm the metamodel approach would improve performance.
>
> Best regards,
> Cristi.
>
>
> Vlad Varnica wrote:
>
>> Hi Cristi,
>
>> I would say you have three options:
>> - very light option is to add directly keywords on the needed UML
>> metamodel element (e.g. I mean on the UML Superstructure)
>> - medium is to use a profile and within this profile to define
>> stereotype. Don't forget that the profile is only a project mechanism
>> and a profile should be added for each modeling project/
>> - advanced is to use EMF/UML codegen mechanism
>
>> We are using the light (e.g keywords) and medium (e.g. stereotype
>> within a profile) and don't have any performance problem. I like
>> keywords option because this is really easy. If your purpose is to
>> extend UML in order to cover DSL then profile is a better option for
>> my point of view.
>> If you want to create your DSL by creating a new model which is not
>> related to the UML Superstructure then I thin this is not the right
>> approach. You can use the UML superstructure and add stereotype and
>> there is no real need to create a new model superstructure which would
>> be specific.
>
>> Your performance problem is not related to EclipseUML2 or EMF but only
>> to the way you use it. My recommendation would be to keep your project
>> modeling extensions simple and to have as few as possible
>> transformation stages.
>
>> Vlad Omondo
>
>
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #478566 is a reply to message #478546] Mon, 29 June 2009 17:52 Go to previous message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Dear Kenn,

I didn't try it yet, but it is a solution indeed. This would solve the
fact that stereotype applications are dynamic EMF objects. And when I need
to work with an object, I should retrieve the stereotype application and
work directly with it (i.e. avoiding element.setValue() and
element.getValue() which give me the impression that do some processing
that can be expensive for repeated calls).

I think I will do some benchmarks with 2 or 3 solutions. When I have
results, I'll get back and post them.

If meanwhile you have opinions on this matter, I would gladly like to hear
them.

Best regards,
Cristi.

Kenn Hussey wrote:

> Cristian,

> Have you tried defining your profiles statically? That will give you an
> API to work with your profile elements and also provides the ability to
> support things like derived stereotype attributes, etc..

> Kenn
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #627717 is a reply to message #478537] Tue, 23 June 2009 08:24 Go to previous message
Vlad Varnica is currently offline Vlad VarnicaFriend
Messages: 546
Registered: July 2009
Location: Milton Keynes - UK
Senior Member
Hi Cristi,

I would say you have three options:
- very light option is to add directly keywords on the needed UML
metamodel element (e.g. I mean on the UML Superstructure)
- medium is to use a profile and within this profile to define stereotype.
Don't forget that the profile is only a project mechanism and a profile
should be added for each modeling project/
- advanced is to use EMF/UML codegen mechanism

We are using the light (e.g keywords) and medium (e.g. stereotype within a
profile) and don't have any performance problem. I like keywords option
because this is really easy. If your purpose is to extend UML in order to
cover DSL then profile is a better option for my point of view.
If you want to create your DSL by creating a new model which is not
related to the UML Superstructure then I thin this is not the right
approach. You can use the UML superstructure and add stereotype and there
is no real need to create a new model superstructure which would be
specific.

Your performance problem is not related to EclipseUML2 or EMF but only to
the way you use it. My recommendation would be to keep your project
modeling extensions simple and to have as few as possible transformation
stages.

Vlad
Omondo
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #627718 is a reply to message #478538] Tue, 23 June 2009 09:38 Go to previous message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Hello Vlad,

And thank you for your answer.

Actually in our project, we use both mechanisms (medium and advanced
according to your terminology). We needed to add some new metaclasses that
are not related to the UML elements, so we created a metamodel extension
(so we have the code generation loop already).

As for the Profile/Stereotypes, we use it to store some additional
information for Packages, Classes, Properties, etc. We access this
additional information (read/write) quite often in our algorithm (code
generation), where every additional operation has an important impact on
the whole execution time.

And the question is if for the above case it's worth to use the metamodel
approach instead of the stereotype based one. So from an architectural
point of view we are very comfortable with the current implementation, but
I think that when running our complex code generation algorithm the
metamodel approach would improve performance.

Best regards,
Cristi.


Vlad Varnica wrote:

> Hi Cristi,

> I would say you have three options:
> - very light option is to add directly keywords on the needed UML
> metamodel element (e.g. I mean on the UML Superstructure)
> - medium is to use a profile and within this profile to define stereotype.
> Don't forget that the profile is only a project mechanism and a profile
> should be added for each modeling project/
> - advanced is to use EMF/UML codegen mechanism

> We are using the light (e.g keywords) and medium (e.g. stereotype within a
> profile) and don't have any performance problem. I like keywords option
> because this is really easy. If your purpose is to extend UML in order to
> cover DSL then profile is a better option for my point of view.
> If you want to create your DSL by creating a new model which is not
> related to the UML Superstructure then I thin this is not the right
> approach. You can use the UML superstructure and add stereotype and there
> is no real need to create a new model superstructure which would be
> specific.

> Your performance problem is not related to EclipseUML2 or EMF but only to
> the way you use it. My recommendation would be to keep your project
> modeling extensions simple and to have as few as possible transformation
> stages.

> Vlad
> Omondo
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #627724 is a reply to message #478539] Wed, 24 June 2009 18:24 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Cristian,

Have you tried defining your profiles statically? That will give you an
API to work with your profile elements and also provides the ability to
support things like derived stereotype attributes, etc..

Kenn

Cristian wrote:
> Hello Vlad,
>
> And thank you for your answer.
>
> Actually in our project, we use both mechanisms (medium and advanced
> according to your terminology). We needed to add some new metaclasses
> that are not related to the UML elements, so we created a metamodel
> extension (so we have the code generation loop already).
>
> As for the Profile/Stereotypes, we use it to store some additional
> information for Packages, Classes, Properties, etc. We access this
> additional information (read/write) quite often in our algorithm (code
> generation), where every additional operation has an important impact on
> the whole execution time.
>
> And the question is if for the above case it's worth to use the
> metamodel approach instead of the stereotype based one. So from an
> architectural point of view we are very comfortable with the current
> implementation, but I think that when running our complex code
> generation algorithm the metamodel approach would improve performance.
>
> Best regards,
> Cristi.
>
>
> Vlad Varnica wrote:
>
>> Hi Cristi,
>
>> I would say you have three options:
>> - very light option is to add directly keywords on the needed UML
>> metamodel element (e.g. I mean on the UML Superstructure)
>> - medium is to use a profile and within this profile to define
>> stereotype. Don't forget that the profile is only a project mechanism
>> and a profile should be added for each modeling project/
>> - advanced is to use EMF/UML codegen mechanism
>
>> We are using the light (e.g keywords) and medium (e.g. stereotype
>> within a profile) and don't have any performance problem. I like
>> keywords option because this is really easy. If your purpose is to
>> extend UML in order to cover DSL then profile is a better option for
>> my point of view.
>> If you want to create your DSL by creating a new model which is not
>> related to the UML Superstructure then I thin this is not the right
>> approach. You can use the UML superstructure and add stereotype and
>> there is no real need to create a new model superstructure which would
>> be specific.
>
>> Your performance problem is not related to EclipseUML2 or EMF but only
>> to the way you use it. My recommendation would be to keep your project
>> modeling extensions simple and to have as few as possible
>> transformation stages.
>
>> Vlad Omondo
>
>
Re: Performance question:Extending the UML metamodel vs Using stereotypes & profiles [message #627748 is a reply to message #478546] Mon, 29 June 2009 17:52 Go to previous message
Cristian Spiescu is currently offline Cristian SpiescuFriend
Messages: 100
Registered: July 2009
Senior Member
Dear Kenn,

I didn't try it yet, but it is a solution indeed. This would solve the
fact that stereotype applications are dynamic EMF objects. And when I need
to work with an object, I should retrieve the stereotype application and
work directly with it (i.e. avoiding element.setValue() and
element.getValue() which give me the impression that do some processing
that can be expensive for repeated calls).

I think I will do some benchmarks with 2 or 3 solutions. When I have
results, I'll get back and post them.

If meanwhile you have opinions on this matter, I would gladly like to hear
them.

Best regards,
Cristi.

Kenn Hussey wrote:

> Cristian,

> Have you tried defining your profiles statically? That will give you an
> API to work with your profile elements and also provides the ability to
> support things like derived stereotype attributes, etc..

> Kenn
Previous Topic:Class templates and associations
Next Topic:Best way to create an uml-approximated metamodel
Goto Forum:
  


Current Time: Fri Apr 19 10:38:06 GMT 2024

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

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

Back to the top