Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Re: Using UML Profiles with EMF
Re: Using UML Profiles with EMF [message #478159] Thu, 05 February 2009 14:00 Go to next message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Joel,

(including the UML2 newsgroup for their perspective)

The MDT UML2 component has been quite successful with their
implementation of Profiles for UML. Also, it's possibly a little-known
fact, but the Profile mechanism is applicable to any UML-based
metamodel, not just the UML, itself. The UML2 run-time library supports
this in any generated metamodel.

So, because Ecore can be described using UML (see the
Ecore.metamodel.uml resource in UML2), one can, in theory, generate
Ecore with profile support. :-D Of course, it's probably best to leave
Ecore to describe itself.

In my own experience, the stereotype mechanism of Profiles offers a very
convenient extension facility which readily supports:

- optionality: the base model element has no reference to the
stereotypes, so stereotypes don't even have to be loaded if
the application doesn't need them
- traceability: UML2 offers the implicit CacheAdapter instance that
facilitates the retrieval of stereotypes applied to an object
- transparency: languages such as OCL have built-in support for
stereotypes because they behave in every respect like additional
metaclasses
- type safety: stereotypes are more explicitly structured than
EAnnotations, and with UML2's static profile definition, can even
have behaviour of their own

It's basically a clean implementation of the classic Adapter/Decorator
pattern, for models. Profiles in themselves are a good reason to use
UML2 and its code generation for your metamodels. Just define your
metamodel with support for stereotype extension, and any client
application can define domain-specific extensions to your metamodel
without the encumbrance of the tight coupling implied by metaclass
specialization.

HTH,

Christian


Joel Rosi-Schwartz wrote:
> Hi,
>
> As a part of our modelling efforts for ORMF the use or UML Profiles has been
> brought up as a possible strategy to enable adopters to extend our core
> model. Since the architectural decision to use EMF has already been made, I
> started researching how one goes about applying UML Profiles to an ecore
> model. So far am not encouraged from my initial Googling, checking the EMF &
> the DSL book and searches on the relevant EF newsgroups.
>
> So I would like to ask this forum for their collective wisdom. Is using UML
> Profiles with EMF a good or bad idea. If it is a good idea, I would
> appreciate pointers to any relevant resources to better understand how to
> marry the two.
>
> Many thanks,
> Joel
>
Re: Using UML Profiles with EMF [message #478174 is a reply to message #478159] Fri, 06 February 2009 18:26 Go to previous messageGo to next message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
Hi Christian,

I am not clear from you post if you are suggesting a way to use Profiles in
conjunction with EMF or if you are simply arguing that Profiles have
features that are difficult to achieve with EMF. Would you care to clarify?

Many thanks,
Joel

On 05/02/2009 14:00, in article gmerdl$kdj$1@build.eclipse.org, "Christian
W. Damus" <cdamus@zeligsoft.com> wrote:

> Hi, Joel,
>
> (including the UML2 newsgroup for their perspective)
>
> The MDT UML2 component has been quite successful with their
> implementation of Profiles for UML. Also, it's possibly a little-known
> fact, but the Profile mechanism is applicable to any UML-based
> metamodel, not just the UML, itself. The UML2 run-time library supports
> this in any generated metamodel.
>
> So, because Ecore can be described using UML (see the
> Ecore.metamodel.uml resource in UML2), one can, in theory, generate
> Ecore with profile support. :-D Of course, it's probably best to leave
> Ecore to describe itself.
>
> In my own experience, the stereotype mechanism of Profiles offers a very
> convenient extension facility which readily supports:
>
> - optionality: the base model element has no reference to the
> stereotypes, so stereotypes don't even have to be loaded if
> the application doesn't need them
> - traceability: UML2 offers the implicit CacheAdapter instance that
> facilitates the retrieval of stereotypes applied to an object
> - transparency: languages such as OCL have built-in support for
> stereotypes because they behave in every respect like additional
> metaclasses
> - type safety: stereotypes are more explicitly structured than
> EAnnotations, and with UML2's static profile definition, can even
> have behaviour of their own
>
> It's basically a clean implementation of the classic Adapter/Decorator
> pattern, for models. Profiles in themselves are a good reason to use
> UML2 and its code generation for your metamodels. Just define your
> metamodel with support for stereotype extension, and any client
> application can define domain-specific extensions to your metamodel
> without the encumbrance of the tight coupling implied by metaclass
> specialization.
>
> HTH,
>
> Christian
>
>
> Joel Rosi-Schwartz wrote:
>> Hi,
>>
>> As a part of our modelling efforts for ORMF the use or UML Profiles has been
>> brought up as a possible strategy to enable adopters to extend our core
>> model. Since the architectural decision to use EMF has already been made, I
>> started researching how one goes about applying UML Profiles to an ecore
>> model. So far am not encouraged from my initial Googling, checking the EMF &
>> the DSL book and searches on the relevant EF newsgroups.
>>
>> So I would like to ask this forum for their collective wisdom. Is using UML
>> Profiles with EMF a good or bad idea. If it is a good idea, I would
>> appreciate pointers to any relevant resources to better understand how to
>> marry the two.
>>
>> Many thanks,
>> Joel
>>

--
Joel Rosi-Schwartz
Etish Limited [http://www.etish.org]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^...^
/ o,o \ The proud parents of Useme & ORMF
|) ::: (| Open Requirements Management Framework
====w=w==== [http://www.eclipse.org/ormf/]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: Using UML Profiles with EMF [message #478180 is a reply to message #478174] Mon, 09 February 2009 16:37 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Joel,

UML2 is an extension of EMF so, in that sense, UML Profiles work with
EMF. They are definitely an EMF-based implementation of the MOF Profile
concept, in any case.

Profiles do provide two significant benefits of modeling over
EAnnotations. One is that they are not referenced by the element that
they extend, so that the element is independent of its stereotypes.
Despite this, the UML2 API makes it easy to access the stereotypes in
the context of the base element. Of course, you can just use Ecore to
describe "stereotypes" that reference the extended element, but the
integration providing the reverse-lookup would have to be a custom
implementation.

The other benefit of stereotypes is that they fit nicely into OCL.
Because UML has associations, OCL can navigate from the base element to
its stereotypes very easily. This is not so easy with Ecore, so your
OCL constraints would have to use inverse-referencing operations that
you model explicitly in your Ecore model.

These on their own may not constitute compelling reasons to chosse UML
and Profiles over Ecore for your metamodelling. I guess it depends on
what integration you need with other technologies. In any case, UML2
does produce an Ecore representation of your metamodel anyway, so you
don't lose any options by taking that route.

HTH,

Christian


Joel Rosi-Schwartz wrote:
> Hi Christian,
>
> I am not clear from you post if you are suggesting a way to use Profiles in
> conjunction with EMF or if you are simply arguing that Profiles have
> features that are difficult to achieve with EMF. Would you care to clarify?
>
> Many thanks,
> Joel
>
> On 05/02/2009 14:00, in article gmerdl$kdj$1@build.eclipse.org, "Christian
> W. Damus" <cdamus@zeligsoft.com> wrote:
>
>> Hi, Joel,
>>
>> (including the UML2 newsgroup for their perspective)
>>
>> The MDT UML2 component has been quite successful with their
>> implementation of Profiles for UML. Also, it's possibly a little-known
>> fact, but the Profile mechanism is applicable to any UML-based
>> metamodel, not just the UML, itself. The UML2 run-time library supports
>> this in any generated metamodel.
>>
>> So, because Ecore can be described using UML (see the
>> Ecore.metamodel.uml resource in UML2), one can, in theory, generate
>> Ecore with profile support. :-D Of course, it's probably best to leave
>> Ecore to describe itself.
>>
>> In my own experience, the stereotype mechanism of Profiles offers a very
>> convenient extension facility which readily supports:
>>
>> - optionality: the base model element has no reference to the
>> stereotypes, so stereotypes don't even have to be loaded if
>> the application doesn't need them
>> - traceability: UML2 offers the implicit CacheAdapter instance that
>> facilitates the retrieval of stereotypes applied to an object
>> - transparency: languages such as OCL have built-in support for
>> stereotypes because they behave in every respect like additional
>> metaclasses
>> - type safety: stereotypes are more explicitly structured than
>> EAnnotations, and with UML2's static profile definition, can even
>> have behaviour of their own
>>
>> It's basically a clean implementation of the classic Adapter/Decorator
>> pattern, for models. Profiles in themselves are a good reason to use
>> UML2 and its code generation for your metamodels. Just define your
>> metamodel with support for stereotype extension, and any client
>> application can define domain-specific extensions to your metamodel
>> without the encumbrance of the tight coupling implied by metaclass
>> specialization.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Joel Rosi-Schwartz wrote:
>>> Hi,
>>>
>>> As a part of our modelling efforts for ORMF the use or UML Profiles has been
>>> brought up as a possible strategy to enable adopters to extend our core
>>> model. Since the architectural decision to use EMF has already been made, I
>>> started researching how one goes about applying UML Profiles to an ecore
>>> model. So far am not encouraged from my initial Googling, checking the EMF &
>>> the DSL book and searches on the relevant EF newsgroups.
>>>
>>> So I would like to ask this forum for their collective wisdom. Is using UML
>>> Profiles with EMF a good or bad idea. If it is a good idea, I would
>>> appreciate pointers to any relevant resources to better understand how to
>>> marry the two.
>>>
>>> Many thanks,
>>> Joel
>>>
>
Re: Using UML Profiles with EMF [message #627374 is a reply to message #478159] Fri, 06 February 2009 18:26 Go to previous message
Joel Rosi-Schwartz is currently offline Joel Rosi-SchwartzFriend
Messages: 624
Registered: July 2009
Location: London. England
Senior Member
Hi Christian,

I am not clear from you post if you are suggesting a way to use Profiles in
conjunction with EMF or if you are simply arguing that Profiles have
features that are difficult to achieve with EMF. Would you care to clarify?

Many thanks,
Joel

On 05/02/2009 14:00, in article gmerdl$kdj$1@build.eclipse.org, "Christian
W. Damus" <cdamus@zeligsoft.com> wrote:

> Hi, Joel,
>
> (including the UML2 newsgroup for their perspective)
>
> The MDT UML2 component has been quite successful with their
> implementation of Profiles for UML. Also, it's possibly a little-known
> fact, but the Profile mechanism is applicable to any UML-based
> metamodel, not just the UML, itself. The UML2 run-time library supports
> this in any generated metamodel.
>
> So, because Ecore can be described using UML (see the
> Ecore.metamodel.uml resource in UML2), one can, in theory, generate
> Ecore with profile support. :-D Of course, it's probably best to leave
> Ecore to describe itself.
>
> In my own experience, the stereotype mechanism of Profiles offers a very
> convenient extension facility which readily supports:
>
> - optionality: the base model element has no reference to the
> stereotypes, so stereotypes don't even have to be loaded if
> the application doesn't need them
> - traceability: UML2 offers the implicit CacheAdapter instance that
> facilitates the retrieval of stereotypes applied to an object
> - transparency: languages such as OCL have built-in support for
> stereotypes because they behave in every respect like additional
> metaclasses
> - type safety: stereotypes are more explicitly structured than
> EAnnotations, and with UML2's static profile definition, can even
> have behaviour of their own
>
> It's basically a clean implementation of the classic Adapter/Decorator
> pattern, for models. Profiles in themselves are a good reason to use
> UML2 and its code generation for your metamodels. Just define your
> metamodel with support for stereotype extension, and any client
> application can define domain-specific extensions to your metamodel
> without the encumbrance of the tight coupling implied by metaclass
> specialization.
>
> HTH,
>
> Christian
>
>
> Joel Rosi-Schwartz wrote:
>> Hi,
>>
>> As a part of our modelling efforts for ORMF the use or UML Profiles has been
>> brought up as a possible strategy to enable adopters to extend our core
>> model. Since the architectural decision to use EMF has already been made, I
>> started researching how one goes about applying UML Profiles to an ecore
>> model. So far am not encouraged from my initial Googling, checking the EMF &
>> the DSL book and searches on the relevant EF newsgroups.
>>
>> So I would like to ask this forum for their collective wisdom. Is using UML
>> Profiles with EMF a good or bad idea. If it is a good idea, I would
>> appreciate pointers to any relevant resources to better understand how to
>> marry the two.
>>
>> Many thanks,
>> Joel
>>

--
Joel Rosi-Schwartz
Etish Limited [http://www.etish.org]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
^...^
/ o,o \ The proud parents of Useme & ORMF
|) ::: (| Open Requirements Management Framework
====w=w==== [http://www.eclipse.org/ormf/]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Re: Using UML Profiles with EMF [message #627380 is a reply to message #478174] Mon, 09 February 2009 16:37 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.zeligsoft.com

Hi, Joel,

UML2 is an extension of EMF so, in that sense, UML Profiles work with
EMF. They are definitely an EMF-based implementation of the MOF Profile
concept, in any case.

Profiles do provide two significant benefits of modeling over
EAnnotations. One is that they are not referenced by the element that
they extend, so that the element is independent of its stereotypes.
Despite this, the UML2 API makes it easy to access the stereotypes in
the context of the base element. Of course, you can just use Ecore to
describe "stereotypes" that reference the extended element, but the
integration providing the reverse-lookup would have to be a custom
implementation.

The other benefit of stereotypes is that they fit nicely into OCL.
Because UML has associations, OCL can navigate from the base element to
its stereotypes very easily. This is not so easy with Ecore, so your
OCL constraints would have to use inverse-referencing operations that
you model explicitly in your Ecore model.

These on their own may not constitute compelling reasons to chosse UML
and Profiles over Ecore for your metamodelling. I guess it depends on
what integration you need with other technologies. In any case, UML2
does produce an Ecore representation of your metamodel anyway, so you
don't lose any options by taking that route.

HTH,

Christian


Joel Rosi-Schwartz wrote:
> Hi Christian,
>
> I am not clear from you post if you are suggesting a way to use Profiles in
> conjunction with EMF or if you are simply arguing that Profiles have
> features that are difficult to achieve with EMF. Would you care to clarify?
>
> Many thanks,
> Joel
>
> On 05/02/2009 14:00, in article gmerdl$kdj$1@build.eclipse.org, "Christian
> W. Damus" <cdamus@zeligsoft.com> wrote:
>
>> Hi, Joel,
>>
>> (including the UML2 newsgroup for their perspective)
>>
>> The MDT UML2 component has been quite successful with their
>> implementation of Profiles for UML. Also, it's possibly a little-known
>> fact, but the Profile mechanism is applicable to any UML-based
>> metamodel, not just the UML, itself. The UML2 run-time library supports
>> this in any generated metamodel.
>>
>> So, because Ecore can be described using UML (see the
>> Ecore.metamodel.uml resource in UML2), one can, in theory, generate
>> Ecore with profile support. :-D Of course, it's probably best to leave
>> Ecore to describe itself.
>>
>> In my own experience, the stereotype mechanism of Profiles offers a very
>> convenient extension facility which readily supports:
>>
>> - optionality: the base model element has no reference to the
>> stereotypes, so stereotypes don't even have to be loaded if
>> the application doesn't need them
>> - traceability: UML2 offers the implicit CacheAdapter instance that
>> facilitates the retrieval of stereotypes applied to an object
>> - transparency: languages such as OCL have built-in support for
>> stereotypes because they behave in every respect like additional
>> metaclasses
>> - type safety: stereotypes are more explicitly structured than
>> EAnnotations, and with UML2's static profile definition, can even
>> have behaviour of their own
>>
>> It's basically a clean implementation of the classic Adapter/Decorator
>> pattern, for models. Profiles in themselves are a good reason to use
>> UML2 and its code generation for your metamodels. Just define your
>> metamodel with support for stereotype extension, and any client
>> application can define domain-specific extensions to your metamodel
>> without the encumbrance of the tight coupling implied by metaclass
>> specialization.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Joel Rosi-Schwartz wrote:
>>> Hi,
>>>
>>> As a part of our modelling efforts for ORMF the use or UML Profiles has been
>>> brought up as a possible strategy to enable adopters to extend our core
>>> model. Since the architectural decision to use EMF has already been made, I
>>> started researching how one goes about applying UML Profiles to an ecore
>>> model. So far am not encouraged from my initial Googling, checking the EMF &
>>> the DSL book and searches on the relevant EF newsgroups.
>>>
>>> So I would like to ask this forum for their collective wisdom. Is using UML
>>> Profiles with EMF a good or bad idea. If it is a good idea, I would
>>> appreciate pointers to any relevant resources to better understand how to
>>> marry the two.
>>>
>>> Many thanks,
>>> Joel
>>>
>
Previous Topic:Redefinition
Next Topic:Loading Model from Enterprise architect
Goto Forum:
  


Current Time: Fri Mar 29 05:24:34 GMT 2024

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

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

Back to the top