Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Modeling Question: EMF Library Model as Profile?
Modeling Question: EMF Library Model as Profile? [message #477927] Wed, 05 November 2008 06:11 Go to next message
Marc Moser is currently offline Marc MoserFriend
Messages: 66
Registered: July 2009
Member
Hi,

I tried to do something similar to the EMF Library Tutorial, but
instead of using EMF, I wanted to use UML and a profile. I encountered
some problems, mostly due to a lack of understanding all the UML
metamodel's properties.

The scenario
---------------

In the EMF world, I have/create the following artifacts:
a) I have the ecore meta-model
b) I create the library model using ecore
c) I create an instance, e.g. using the editors EMF generates from b)

Now, in the UML world, I have these artifacts:
a) I have the uml meta-model
b) I create a profile to "adapt" the uml meta-model
c) I crate an instance of the uml meta-model... now here I have to
switch my conceptual point-of-view and consider the uml meta-model as
my model. I can then apply the profile to it, and create an instance.
Doing so, I can re-use the available UML tooling to create the
instance.

The Questions
-----------------

1) It seems as if I could define several profiles to hold the same
information as the ecore library model. Is there already a way of
transforming an ecore model to a profile that could be considered as a
"standard" way of doing it?

2) I wanted to do it like this (only part of library model): created
three stereotypes on metamodel-element "Class", called "Library",
"Book", "Writer". Then I created two stereotypes called
"Library_Writers" and "Library_Books" on metamodel-element
"Association".
Applying this profile to UML, I was able to create a library instance
(Library0), some Books (Book0..BookN) and some Writers
(Writer0..WriterM). But I don't know how to:

- Restrict the model such that only instances of the above stereotypes
can be created, no other elements. I tried with the "strict=true" in
the profile application, but I could still create other elements and
successfully validate the resource (I'm currently working on latest
3.4 modeling release build)

- Create the associations between the Library0 and Book0..BookN. My
idea was to create normal associations, and then apply the stereotype
"Library_Books" to it. But how can I now specify the association ends?
In normal class diagrams, I can easily create associations with the
diagram-editor, but here, I would like to set the properties manually,
and I don't really know what properties to set.

- Concerning the "Library_Books" stereotype, how can I spedify that
only "Library" is allowed on one end, and only "Book"s are allowed on
the other end?

Thanks for your help!

All the best,
Marc
Re: Modeling Question: EMF Library Model as Profile? [message #477935 is a reply to message #477927] Wed, 05 November 2008 21:20 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Marc,

1) Support for mapping between profiles and their equivalent metamodel
representations is something we aim to provide in the proposed MST project
(see http://www.eclipse.org/proposals/mst/), albeit from a (specification)
metamodeler's perspective. Indeed, given the capabiliities of profiles in
UML 2.x, and the fact that most tools have taken a MOF-oriented approach to
supporting profiles, the lines between a metamodel and a profile have become
blurred. This is in fact a current topic of discussion at the OMG.

2) Support for restricting tooling to hide UML concepts that aren't
pertinent to a given domain via a profile (e.g. "strict mode") is something
that needs to be provided at the tooling level. The editor and associated
actions in the UML2 project are really just samples, and so such support has
yet to be provided (contributions would be most welcome!). Details on how to
create assocation ends both programatically and via the UI can be found in
the "Getting Started with UML2" article on the wiki; the same concepts
should apply to stereotyped associations/ends. Constraining the ends to
specific types is something that would need to be done via a constraint
defined on the stereotype; again, support for enforcing such constraints is
a tooling issue.

Kenn

"Marc Moser" <moser@montages.com> wrote in message
news:n3c2h454p1h2nvteb6jh1fi2tpolum5qmt@4ax.com...
> Hi,
>
> I tried to do something similar to the EMF Library Tutorial, but
> instead of using EMF, I wanted to use UML and a profile. I encountered
> some problems, mostly due to a lack of understanding all the UML
> metamodel's properties.
>
> The scenario
> ---------------
>
> In the EMF world, I have/create the following artifacts:
> a) I have the ecore meta-model
> b) I create the library model using ecore
> c) I create an instance, e.g. using the editors EMF generates from b)
>
> Now, in the UML world, I have these artifacts:
> a) I have the uml meta-model
> b) I create a profile to "adapt" the uml meta-model
> c) I crate an instance of the uml meta-model... now here I have to
> switch my conceptual point-of-view and consider the uml meta-model as
> my model. I can then apply the profile to it, and create an instance.
> Doing so, I can re-use the available UML tooling to create the
> instance.
>
> The Questions
> -----------------
>
> 1) It seems as if I could define several profiles to hold the same
> information as the ecore library model. Is there already a way of
> transforming an ecore model to a profile that could be considered as a
> "standard" way of doing it?
>
> 2) I wanted to do it like this (only part of library model): created
> three stereotypes on metamodel-element "Class", called "Library",
> "Book", "Writer". Then I created two stereotypes called
> "Library_Writers" and "Library_Books" on metamodel-element
> "Association".
> Applying this profile to UML, I was able to create a library instance
> (Library0), some Books (Book0..BookN) and some Writers
> (Writer0..WriterM). But I don't know how to:
>
> - Restrict the model such that only instances of the above stereotypes
> can be created, no other elements. I tried with the "strict=true" in
> the profile application, but I could still create other elements and
> successfully validate the resource (I'm currently working on latest
> 3.4 modeling release build)
>
> - Create the associations between the Library0 and Book0..BookN. My
> idea was to create normal associations, and then apply the stereotype
> "Library_Books" to it. But how can I now specify the association ends?
> In normal class diagrams, I can easily create associations with the
> diagram-editor, but here, I would like to set the properties manually,
> and I don't really know what properties to set.
>
> - Concerning the "Library_Books" stereotype, how can I spedify that
> only "Library" is allowed on one end, and only "Book"s are allowed on
> the other end?
>
> Thanks for your help!
>
> All the best,
> Marc
Re: Modeling Question: EMF Library Model as Profile? [message #627144 is a reply to message #477927] Wed, 05 November 2008 21:20 Go to previous message
Kenn Hussey is currently offline Kenn HusseyFriend
Messages: 1620
Registered: July 2009
Senior Member
Marc,

1) Support for mapping between profiles and their equivalent metamodel
representations is something we aim to provide in the proposed MST project
(see http://www.eclipse.org/proposals/mst/), albeit from a (specification)
metamodeler's perspective. Indeed, given the capabiliities of profiles in
UML 2.x, and the fact that most tools have taken a MOF-oriented approach to
supporting profiles, the lines between a metamodel and a profile have become
blurred. This is in fact a current topic of discussion at the OMG.

2) Support for restricting tooling to hide UML concepts that aren't
pertinent to a given domain via a profile (e.g. "strict mode") is something
that needs to be provided at the tooling level. The editor and associated
actions in the UML2 project are really just samples, and so such support has
yet to be provided (contributions would be most welcome!). Details on how to
create assocation ends both programatically and via the UI can be found in
the "Getting Started with UML2" article on the wiki; the same concepts
should apply to stereotyped associations/ends. Constraining the ends to
specific types is something that would need to be done via a constraint
defined on the stereotype; again, support for enforcing such constraints is
a tooling issue.

Kenn

"Marc Moser" <moser@montages.com> wrote in message
news:n3c2h454p1h2nvteb6jh1fi2tpolum5qmt@4ax.com...
> Hi,
>
> I tried to do something similar to the EMF Library Tutorial, but
> instead of using EMF, I wanted to use UML and a profile. I encountered
> some problems, mostly due to a lack of understanding all the UML
> metamodel's properties.
>
> The scenario
> ---------------
>
> In the EMF world, I have/create the following artifacts:
> a) I have the ecore meta-model
> b) I create the library model using ecore
> c) I create an instance, e.g. using the editors EMF generates from b)
>
> Now, in the UML world, I have these artifacts:
> a) I have the uml meta-model
> b) I create a profile to "adapt" the uml meta-model
> c) I crate an instance of the uml meta-model... now here I have to
> switch my conceptual point-of-view and consider the uml meta-model as
> my model. I can then apply the profile to it, and create an instance.
> Doing so, I can re-use the available UML tooling to create the
> instance.
>
> The Questions
> -----------------
>
> 1) It seems as if I could define several profiles to hold the same
> information as the ecore library model. Is there already a way of
> transforming an ecore model to a profile that could be considered as a
> "standard" way of doing it?
>
> 2) I wanted to do it like this (only part of library model): created
> three stereotypes on metamodel-element "Class", called "Library",
> "Book", "Writer". Then I created two stereotypes called
> "Library_Writers" and "Library_Books" on metamodel-element
> "Association".
> Applying this profile to UML, I was able to create a library instance
> (Library0), some Books (Book0..BookN) and some Writers
> (Writer0..WriterM). But I don't know how to:
>
> - Restrict the model such that only instances of the above stereotypes
> can be created, no other elements. I tried with the "strict=true" in
> the profile application, but I could still create other elements and
> successfully validate the resource (I'm currently working on latest
> 3.4 modeling release build)
>
> - Create the associations between the Library0 and Book0..BookN. My
> idea was to create normal associations, and then apply the stereotype
> "Library_Books" to it. But how can I now specify the association ends?
> In normal class diagrams, I can easily create associations with the
> diagram-editor, but here, I would like to set the properties manually,
> and I don't really know what properties to set.
>
> - Concerning the "Library_Books" stereotype, how can I spedify that
> only "Library" is allowed on one end, and only "Book"s are allowed on
> the other end?
>
> Thanks for your help!
>
> All the best,
> Marc
Previous Topic:[Announce] MDT UML2 3.0.0M3 is available
Next Topic:Cast UML model elements
Goto Forum:
  


Current Time: Thu Apr 25 10:46:31 GMT 2024

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

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

Back to the top