the following text is quite long, so if you're in a rush just read
abstract, look at the picture, read constraints, the idea and the last
point of ecore-mapping.

Abstract:
basically I want to be able to read & write proper UML2 models with my
GMF-DSL Editor. For me this sounds like a real common problem, but I'm
going to outline it in detail because I didn't find a good way to start
/ solve it.

Use Case:
We're working with MDSD and already have a cardridge for a domain. Right
now, the generator gets the model from an uml2 tool. The graphical
editor I have to make (using GMF) for this domain should be able to read
and write uml2 models because of reasons like flexibility (wheather or
not to use my editor) or extended control of an uml tool (e.g to model
the DTOs in the same file). Both, UML2 Tools and the generator accept
uml2 models from ecore.

DSL:
There various reasons why a tend to create my own domain specific
language (DSL) for my graphical editor (GE) in contrast to use uml2.ecore:
* a DSL which uses around 10 classes seems to be overburdened if it's
based on the uml2.ecore with several hundred classes.
* not that error prone because less confusion for the GMF framework and
even more important for me.
* some constraints are already implicit from my DSL Metamodel (MM) and
the others should be easier to write on a simple MM.
* It seems unhandy to create the uml2.ecore model code (after 5 hours I
stopped the generation).
* there must be a reason why GMF enforces the creation of DSLs rather
than building a customized UML2 editor.

The two worlds:
This results in two worlds for my "MetaModel" sketch (see attached
picture). In the left corner, we see famous UML with his well known
metaclasses and packages. On the right corner we can see the young DSL
also with metaclasses described in ecore. Now my experiments showed that
the heavyweigth extensions in which I extended classes from the
uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
still be able to use standard uml tools is the lightweight approach. I
sketched this with the outer circle around uml.

Contraints:
* I assume that I'm not restricting UML and
* that every DSL Class has a pendant in uml with a lack of semantics
expressable by stereotypes.
* both MM are defined in EMF.

The idea:
is to connect my DSL-MM with the uml2-MM. This should be realizable by
creating a profile with sterotypes and enumerations for my DSL and
represent my DSL classes in uml with the appropriate stereotype. I
illustrated this in the 2nd picture "Concrete example" which shows
instances of both MM. So on the right we can see the instance classes of
MyDSL: a container, a class named Ex1 which is an instance of
DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
association between Ex1 and Ex2 and a class named Ex3 which is an
instance of DSL-Class#2. Now I want to map them to UML. Following my
example this would result in mapping:
* an instance of container to an uml-package with sterotype dsl-container
* an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
sterotype dsl-class#1
* an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
sterotype dsl-class#1
* an association between Ex1 and Ex2 to an uml association (which may be
stereotyped as "dsl-association if easier)
* an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
sterotype dsl-class#2

Other Mapping possibilities (mentioned if my vision doesn't work in time):
* Model-to-Model transformation is an option. I rather dislike this for
the classic reasons e.g. consistency between the models, overwriting or
synchronization of changes and -for me the most important one- possible
information loss due to the lack of representation in one language. In
my example this means that if a "NotDslClass" exists in the left UML
world for which I have no representation in MyDSL there is no need to
represent it in MyDSL. But I guess I would be forced to handle it
somehow not to loose information in the back-to-uml transformation.
* Customized XML/XMI serialization through extending the XMLHelper also
seems error prone and seems to require a good knowledge of XMI,too.

Ecore Mapping:
So a better approach would be to simulate the DSL-MM for my GMF-DSL
editor but actually work directly on an UML model. I found the EMF part
of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
found the some starting points or ideas how to realize it. My problem is
I can hardly value them nor I know a kind of best practice for this. So
it would be really nice to start a discussion about them or if you say
just read this f****** manual because I'm stuck right now ;(
* refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
like an option but my impression is that this is not really what I want.
* Abuse the Model classes (or facades), normally generated by generate
model code as an adapter to eclipse-uml2 facades seems like a lot of
work implying a pretty good understanding of EMF.
* My Favourite: to use the Ecore2Ecore mapper and a customized rescource
handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
it's just mentioned and not really described, but it seems exactly like
what I want. This feeling is emphazied by features like
OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
resources about that or if there isn't a simple proof-of-concept example
somewhere.

It is indeed a long post and I actually can't find a single "?" in it,
so I'm not really sure what to say. I does sound like it would be
perhaps a lot simpler to design your own independent model that has no
relation to UML2, but I don't think I really understood well all the
issues and concerns...

SKuhn wrote:
> hi folks,
>
> the following text is quite long, so if you're in a rush just read
> abstract, look at the picture, read constraints, the idea and the last
> point of ecore-mapping.
>
> Abstract:
> basically I want to be able to read & write proper UML2 models with my
> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> going to outline it in detail because I didn't find a good way to
> start / solve it.
>
> Use Case:
> We're working with MDSD and already have a cardridge for a domain.
> Right now, the generator gets the model from an uml2 tool. The
> graphical editor I have to make (using GMF) for this domain should be
> able to read and write uml2 models because of reasons like flexibility
> (wheather or not to use my editor) or extended control of an uml tool
> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
> generator accept uml2 models from ecore.
>
> DSL:
> There various reasons why a tend to create my own domain specific
> language (DSL) for my graphical editor (GE) in contrast to use
> uml2.ecore:
> * a DSL which uses around 10 classes seems to be overburdened if it's
> based on the uml2.ecore with several hundred classes.
> * not that error prone because less confusion for the GMF framework
> and even more important for me.
> * some constraints are already implicit from my DSL Metamodel (MM) and
> the others should be easier to write on a simple MM.
> * It seems unhandy to create the uml2.ecore model code (after 5 hours
> I stopped the generation).
> * there must be a reason why GMF enforces the creation of DSLs rather
> than building a customized UML2 editor.
>
> The two worlds:
> This results in two worlds for my "MetaModel" sketch (see attached
> picture). In the left corner, we see famous UML with his well known
> metaclasses and packages. On the right corner we can see the young DSL
> also with metaclasses described in ecore. Now my experiments showed
> that the heavyweigth extensions in which I extended classes from the
> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
> and still be able to use standard uml tools is the lightweight
> approach. I sketched this with the outer circle around uml.
>
> Contraints:
> * I assume that I'm not restricting UML and
> * that every DSL Class has a pendant in uml with a lack of semantics
> expressable by stereotypes.
> * both MM are defined in EMF.
>
> The idea:
> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> creating a profile with sterotypes and enumerations for my DSL and
> represent my DSL classes in uml with the appropriate stereotype. I
> illustrated this in the 2nd picture "Concrete example" which shows
> instances of both MM. So on the right we can see the instance classes
> of MyDSL: a container, a class named Ex1 which is an instance of
> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> association between Ex1 and Ex2 and a class named Ex3 which is an
> instance of DSL-Class#2. Now I want to map them to UML. Following my
> example this would result in mapping:
> * an instance of container to an uml-package with sterotype dsl-container
> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> sterotype dsl-class#1
> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> sterotype dsl-class#1
> * an association between Ex1 and Ex2 to an uml association (which may
> be stereotyped as "dsl-association if easier)
> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> sterotype dsl-class#2
>
> Other Mapping possibilities (mentioned if my vision doesn't work in
> time):
> * Model-to-Model transformation is an option. I rather dislike this
> for the classic reasons e.g. consistency between the models,
> overwriting or synchronization of changes and -for me the most
> important one- possible information loss due to the lack of
> representation in one language. In my example this means that if a
> "NotDslClass" exists in the left UML world for which I have no
> representation in MyDSL there is no need to represent it in MyDSL. But
> I guess I would be forced to handle it somehow not to loose
> information in the back-to-uml transformation.
> * Customized XML/XMI serialization through extending the XMLHelper
> also seems error prone and seems to require a good knowledge of XMI,too.
>
> Ecore Mapping:
> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> editor but actually work directly on an UML model. I found the EMF
> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> found the some starting points or ideas how to realize it. My problem
> is I can hardly value them nor I know a kind of best practice for
> this. So it would be really nice to start a discussion about them or
> if you say just read this f****** manual because I'm stuck right now ;(
> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
> looks like an option but my impression is that this is not really what
> I want.
> * Abuse the Model classes (or facades), normally generated by generate
> model code as an adapter to eclipse-uml2 facades seems like a lot of
> work implying a pretty good understanding of EMF.
> * My Favourite: to use the Ecore2Ecore mapper and a customized
> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
> here is that it's just mentioned and not really described, but it
> seems exactly like what I want. This feeling is emphazied by features
> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> resources about that or if there isn't a simple proof-of-concept
> example somewhere.
>
> Thanks for reading already
> -stefan
>
>
> ------------------------------------------------------------ ------------
>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Stefan,<br>
<br>
It is indeed a long post and I actually can't find a single "?" in it,
so I'm not really sure what to say.

I expressed my hopes with "So it would be really nice to start a
discussion about them or if you say just read this f****** manual
because I'm stuck right now ;( " in a way that people can say I did it
this way or this way is really awful/awesome or this is the best way to
do it.

and later on my 'question' in the last point "I'm wondering where I can
find good resources about that or if there isn't a simple
proof-of-concept example somewhere.".

Anyway, the question-representation looks like this:
Does anybody know good resources which may help me realizing My
Favourite approach(the last) point under EcoreMapping?

I can't imagine that this is a new problem/approach, so is there already
a proof-of-concept example somewhere?

> I does sound like it would be
> perhaps a lot simpler to design your own independent model that has no
> relation to UML2
Of course ;). My problem is that I somehow need this representation in
UML (I described this in Use Case).

greets
stefan

Ed Merks schrieb:
> Stefan,
>
> It is indeed a long post and I actually can't find a single "?" in it,
> so I'm not really sure what to say. , but I don't think I really understood well all the
> issues and concerns...
>
>
> SKuhn wrote:
>> hi folks,
>>
>> the following text is quite long, so if you're in a rush just read
>> abstract, look at the picture, read constraints, the idea and the last
>> point of ecore-mapping.
>>
>> Abstract:
>> basically I want to be able to read & write proper UML2 models with my
>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>> going to outline it in detail because I didn't find a good way to
>> start / solve it.
>>
>> Use Case:
>> We're working with MDSD and already have a cardridge for a domain.
>> Right now, the generator gets the model from an uml2 tool. The
>> graphical editor I have to make (using GMF) for this domain should be
>> able to read and write uml2 models because of reasons like flexibility
>> (wheather or not to use my editor) or extended control of an uml tool
>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>> generator accept uml2 models from ecore.
>>
>> DSL:
>> There various reasons why a tend to create my own domain specific
>> language (DSL) for my graphical editor (GE) in contrast to use
>> uml2.ecore:
>> * a DSL which uses around 10 classes seems to be overburdened if it's
>> based on the uml2.ecore with several hundred classes.
>> * not that error prone because less confusion for the GMF framework
>> and even more important for me.
>> * some constraints are already implicit from my DSL Metamodel (MM) and
>> the others should be easier to write on a simple MM.
>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>> I stopped the generation).
>> * there must be a reason why GMF enforces the creation of DSLs rather
>> than building a customized UML2 editor.
>>
>> The two worlds:
>> This results in two worlds for my "MetaModel" sketch (see attached
>> picture). In the left corner, we see famous UML with his well known
>> metaclasses and packages. On the right corner we can see the young DSL
>> also with metaclasses described in ecore. Now my experiments showed
>> that the heavyweigth extensions in which I extended classes from the
>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>> and still be able to use standard uml tools is the lightweight
>> approach. I sketched this with the outer circle around uml.
>>
>> Contraints:
>> * I assume that I'm not restricting UML and
>> * that every DSL Class has a pendant in uml with a lack of semantics
>> expressable by stereotypes.
>> * both MM are defined in EMF.
>>
>> The idea:
>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>> creating a profile with sterotypes and enumerations for my DSL and
>> represent my DSL classes in uml with the appropriate stereotype. I
>> illustrated this in the 2nd picture "Concrete example" which shows
>> instances of both MM. So on the right we can see the instance classes
>> of MyDSL: a container, a class named Ex1 which is an instance of
>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>> association between Ex1 and Ex2 and a class named Ex3 which is an
>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>> example this would result in mapping:
>> * an instance of container to an uml-package with sterotype dsl-container
>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>> sterotype dsl-class#1
>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>> sterotype dsl-class#1
>> * an association between Ex1 and Ex2 to an uml association (which may
>> be stereotyped as "dsl-association if easier)
>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>> sterotype dsl-class#2
>>
>> Other Mapping possibilities (mentioned if my vision doesn't work in
>> time):
>> * Model-to-Model transformation is an option. I rather dislike this
>> for the classic reasons e.g. consistency between the models,
>> overwriting or synchronization of changes and -for me the most
>> important one- possible information loss due to the lack of
>> representation in one language. In my example this means that if a
>> "NotDslClass" exists in the left UML world for which I have no
>> representation in MyDSL there is no need to represent it in MyDSL. But
>> I guess I would be forced to handle it somehow not to loose
>> information in the back-to-uml transformation.
>> * Customized XML/XMI serialization through extending the XMLHelper
>> also seems error prone and seems to require a good knowledge of XMI,too.
>>
>> Ecore Mapping:
>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>> editor but actually work directly on an UML model. I found the EMF
>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>> found the some starting points or ideas how to realize it. My problem
>> is I can hardly value them nor I know a kind of best practice for
>> this. So it would be really nice to start a discussion about them or
>> if you say just read this f****** manual because I'm stuck right now ;(
>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>> looks like an option but my impression is that this is not really what
>> I want.
>> * Abuse the Model classes (or facades), normally generated by generate
>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>> work implying a pretty good understanding of EMF.
>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>> here is that it's just mentioned and not really described, but it
>> seems exactly like what I want. This feeling is emphazied by features
>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>> resources about that or if there isn't a simple proof-of-concept
>> example somewhere.
>>
>> Thanks for reading already
>> -stefan
>>
>>
>> ------------------------------------------------------------ ------------
>>
>

For an example of the ecore2ecore mapping have a look at
org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml. This
is a mapping between older and newer verion of UML and is used for forward
migration. The org.eclipse.uml2.uml.resource contains code behind the
migration. ( you might want to have a look at the migration guide from the
UML wiki .. it explains the mapping in a human readable format ).

There are draft articles for creating DSL in bugzilla [77413], and links
from the UML wiki.

You might also want to have a look at the UMLTools project for creating
editors for your own metamodel.

Hope that helps,

- James.

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jhq2$76t$1@build.eclipse.org...
> Hi Ed,
>
> I expressed my hopes with "So it would be really nice to start a
> discussion about them or if you say just read this f****** manual
> because I'm stuck right now ;( " in a way that people can say I did it
> this way or this way is really awful/awesome or this is the best way to
> do it.
>
> and later on my 'question' in the last point "I'm wondering where I can
> find good resources about that or if there isn't a simple
> proof-of-concept example somewhere.".
>
> Anyway, the question-representation looks like this:
> Does anybody know good resources which may help me realizing My
> Favourite approach(the last) point under EcoreMapping?
>
> I can't imagine that this is a new problem/approach, so is there already
> a proof-of-concept example somewhere?
>
> > I does sound like it would be
> > perhaps a lot simpler to design your own independent model that has no
> > relation to UML2
> Of course ;). My problem is that I somehow need this representation in
> UML (I described this in Use Case).
>
> greets
> stefan
>
>
>
>
>
> Ed Merks schrieb:
> > Stefan,
> >
> > It is indeed a long post and I actually can't find a single "?" in it,
> > so I'm not really sure what to say. , but I don't think I really
understood well all the
> > issues and concerns...
> >
> >
> > SKuhn wrote:
> >> hi folks,
> >>
> >> the following text is quite long, so if you're in a rush just read
> >> abstract, look at the picture, read constraints, the idea and the last
> >> point of ecore-mapping.
> >>
> >> Abstract:
> >> basically I want to be able to read & write proper UML2 models with my
> >> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> >> going to outline it in detail because I didn't find a good way to
> >> start / solve it.
> >>
> >> Use Case:
> >> We're working with MDSD and already have a cardridge for a domain.
> >> Right now, the generator gets the model from an uml2 tool. The
> >> graphical editor I have to make (using GMF) for this domain should be
> >> able to read and write uml2 models because of reasons like flexibility
> >> (wheather or not to use my editor) or extended control of an uml tool
> >> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
> >> generator accept uml2 models from ecore.
> >>
> >> DSL:
> >> There various reasons why a tend to create my own domain specific
> >> language (DSL) for my graphical editor (GE) in contrast to use
> >> uml2.ecore:
> >> * a DSL which uses around 10 classes seems to be overburdened if it's
> >> based on the uml2.ecore with several hundred classes.
> >> * not that error prone because less confusion for the GMF framework
> >> and even more important for me.
> >> * some constraints are already implicit from my DSL Metamodel (MM) and
> >> the others should be easier to write on a simple MM.
> >> * It seems unhandy to create the uml2.ecore model code (after 5 hours
> >> I stopped the generation).
> >> * there must be a reason why GMF enforces the creation of DSLs rather
> >> than building a customized UML2 editor.
> >>
> >> The two worlds:
> >> This results in two worlds for my "MetaModel" sketch (see attached
> >> picture). In the left corner, we see famous UML with his well known
> >> metaclasses and packages. On the right corner we can see the young DSL
> >> also with metaclasses described in ecore. Now my experiments showed
> >> that the heavyweigth extensions in which I extended classes from the
> >> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
> >> and still be able to use standard uml tools is the lightweight
> >> approach. I sketched this with the outer circle around uml.
> >>
> >> Contraints:
> >> * I assume that I'm not restricting UML and
> >> * that every DSL Class has a pendant in uml with a lack of semantics
> >> expressable by stereotypes.
> >> * both MM are defined in EMF.
> >>
> >> The idea:
> >> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> >> creating a profile with sterotypes and enumerations for my DSL and
> >> represent my DSL classes in uml with the appropriate stereotype. I
> >> illustrated this in the 2nd picture "Concrete example" which shows
> >> instances of both MM. So on the right we can see the instance classes
> >> of MyDSL: a container, a class named Ex1 which is an instance of
> >> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> >> association between Ex1 and Ex2 and a class named Ex3 which is an
> >> instance of DSL-Class#2. Now I want to map them to UML. Following my
> >> example this would result in mapping:
> >> * an instance of container to an uml-package with sterotype
dsl-container
> >> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> >> sterotype dsl-class#1
> >> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> >> sterotype dsl-class#1
> >> * an association between Ex1 and Ex2 to an uml association (which may
> >> be stereotyped as "dsl-association if easier)
> >> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> >> sterotype dsl-class#2
> >>
> >> Other Mapping possibilities (mentioned if my vision doesn't work in
> >> time):
> >> * Model-to-Model transformation is an option. I rather dislike this
> >> for the classic reasons e.g. consistency between the models,
> >> overwriting or synchronization of changes and -for me the most
> >> important one- possible information loss due to the lack of
> >> representation in one language. In my example this means that if a
> >> "NotDslClass" exists in the left UML world for which I have no
> >> representation in MyDSL there is no need to represent it in MyDSL. But
> >> I guess I would be forced to handle it somehow not to loose
> >> information in the back-to-uml transformation.
> >> * Customized XML/XMI serialization through extending the XMLHelper
> >> also seems error prone and seems to require a good knowledge of
XMI,too.
> >>
> >> Ecore Mapping:
> >> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> >> editor but actually work directly on an UML model. I found the EMF
> >> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> >> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> >> found the some starting points or ideas how to realize it. My problem
> >> is I can hardly value them nor I know a kind of best practice for
> >> this. So it would be really nice to start a discussion about them or
> >> if you say just read this f****** manual because I'm stuck right now ;(
> >> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
> >> looks like an option but my impression is that this is not really what
> >> I want.
> >> * Abuse the Model classes (or facades), normally generated by generate
> >> model code as an adapter to eclipse-uml2 facades seems like a lot of
> >> work implying a pretty good understanding of EMF.
> >> * My Favourite: to use the Ecore2Ecore mapper and a customized
> >> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
> >> here is that it's just mentioned and not really described, but it
> >> seems exactly like what I want. This feeling is emphazied by features
> >> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> >> resources about that or if there isn't a simple proof-of-concept
> >> example somewhere.
> >>
> >> Thanks for reading already
> >> -stefan
> >>
> >>
>
>> ------------------------------------------------------------ ------------
> >>
> >

> For an example of the ecore2ecore mapping have a look at
> org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
This
> is a mapping between older and newer verion of UML and is used for
forward
> migration. The org.eclipse.uml2.uml.resource contains code behind the
> migration. ( you might want to have a look at the migration guide
from the
> UML wiki .. it explains the mapping in a human readable format ).
I stumbled over it some weeks ago but skipped it because I thought it
has nothing to do with my problem. So I'm definitly going to take a look
on it soon. Thanks for the hint.

> There are draft articles for creating DSL in bugzilla [77413], and links
> from the UML wiki.
> You might also want to have a look at the UMLTools project for creating
> editors for your own metamodel.
I already looked at both. I played around with Heavyweight-Extensions
but it seemed preety much that other UML Tools e.g. MagicDraw won't
handle heavyweight extensions at all. So customizing the UML editor of
UMLTools is not an option neither.

I found an error in my first post:
"Now my experiments showed that the heavyweigth extensions in which I
extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant.
So the only way to customize uml and still be able to use standard uml
tools is the lightweight approach."

thanks so far
-stefan

>
> Hope that helps,
>
> - James.
>
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jhq2$76t$1@build.eclipse.org...
>> Hi Ed,
>>
>> I expressed my hopes with "So it would be really nice to start a
>> discussion about them or if you say just read this f****** manual
>> because I'm stuck right now ;( " in a way that people can say I did it
>> this way or this way is really awful/awesome or this is the best way to
>> do it.
>>
>> and later on my 'question' in the last point "I'm wondering where I can
>> find good resources about that or if there isn't a simple
>> proof-of-concept example somewhere.".
>>
>> Anyway, the question-representation looks like this:
>> Does anybody know good resources which may help me realizing My
>> Favourite approach(the last) point under EcoreMapping?
>>
>> I can't imagine that this is a new problem/approach, so is there already
>> a proof-of-concept example somewhere?
>>
>> > I does sound like it would be
>> > perhaps a lot simpler to design your own independent model that has no
>> > relation to UML2
>> Of course ;). My problem is that I somehow need this representation in
>> UML (I described this in Use Case).
>>
>> greets
>> stefan
>>
>>
>>
>>
>>
>> Ed Merks schrieb:
>>> Stefan,
>>>
>>> It is indeed a long post and I actually can't find a single "?" in it,
>>> so I'm not really sure what to say. , but I don't think I really
> understood well all the
>>> issues and concerns...
>>>
>>>
>>> SKuhn wrote:
>>>> hi folks,
>>>>
>>>> the following text is quite long, so if you're in a rush just read
>>>> abstract, look at the picture, read constraints, the idea and the last
>>>> point of ecore-mapping.
>>>>
>>>> Abstract:
>>>> basically I want to be able to read & write proper UML2 models with my
>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>> going to outline it in detail because I didn't find a good way to
>>>> start / solve it.
>>>>
>>>> Use Case:
>>>> We're working with MDSD and already have a cardridge for a domain.
>>>> Right now, the generator gets the model from an uml2 tool. The
>>>> graphical editor I have to make (using GMF) for this domain should be
>>>> able to read and write uml2 models because of reasons like flexibility
>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>> generator accept uml2 models from ecore.
>>>>
>>>> DSL:
>>>> There various reasons why a tend to create my own domain specific
>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>> uml2.ecore:
>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>> based on the uml2.ecore with several hundred classes.
>>>> * not that error prone because less confusion for the GMF framework
>>>> and even more important for me.
>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>> the others should be easier to write on a simple MM.
>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>> I stopped the generation).
>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>> than building a customized UML2 editor.
>>>>
>>>> The two worlds:
>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>> picture). In the left corner, we see famous UML with his well known
>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>> also with metaclasses described in ecore. Now my experiments showed
>>>> that the heavyweigth extensions in which I extended classes from the
>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>> and still be able to use standard uml tools is the lightweight
>>>> approach. I sketched this with the outer circle around uml.
>>>>
>>>> Contraints:
>>>> * I assume that I'm not restricting UML and
>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>> expressable by stereotypes.
>>>> * both MM are defined in EMF.
>>>>
>>>> The idea:
>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>> instances of both MM. So on the right we can see the instance classes
>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>> example this would result in mapping:
>>>> * an instance of container to an uml-package with sterotype
> dsl-container
>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>> sterotype dsl-class#1
>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>> sterotype dsl-class#1
>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>> be stereotyped as "dsl-association if easier)
>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>> sterotype dsl-class#2
>>>>
>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>> time):
>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>> for the classic reasons e.g. consistency between the models,
>>>> overwriting or synchronization of changes and -for me the most
>>>> important one- possible information loss due to the lack of
>>>> representation in one language. In my example this means that if a
>>>> "NotDslClass" exists in the left UML world for which I have no
>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>> I guess I would be forced to handle it somehow not to loose
>>>> information in the back-to-uml transformation.
>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>> also seems error prone and seems to require a good knowledge of
> XMI,too.
>>>> Ecore Mapping:
>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>> editor but actually work directly on an UML model. I found the EMF
>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>> found the some starting points or ideas how to realize it. My problem
>>>> is I can hardly value them nor I know a kind of best practice for
>>>> this. So it would be really nice to start a discussion about them or
>>>> if you say just read this f****** manual because I'm stuck right now ;(
>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>> looks like an option but my impression is that this is not really what
>>>> I want.
>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>> work implying a pretty good understanding of EMF.
>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>> here is that it's just mentioned and not really described, but it
>>>> seems exactly like what I want. This feeling is emphazied by features
>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>> resources about that or if there isn't a simple proof-of-concept
>>>> example somewhere.
>>>>
>>>> Thanks for reading already
>>>> -stefan
>>>>
>>>>
>>> ------------------------------------------------------------ ------------
>
>

Two forces:
You must facilitate modeling of instances of your DSL in your Tool.
You must interoperate with UML tools.

Deal with them separately:

Do your custom DSL editor, i.e. with GMF
Convert to/from Eclipse UML2.1 with Model2Model transformations,
Save UML2 interoperable .xmi files from Eclipse UML2.1
(some tools will not interoperate with the default .xmi from Eclipse)
Keep asking, to figure out how to interoperate with Diagrams
from other tools.

Cheers,
Antonio

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jtnn$d33$1@build.eclipse.org...
> hi james,
>
> > For an example of the ecore2ecore mapping have a look at
> > org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
> This
> > is a mapping between older and newer verion of UML and is used for
> forward
> > migration. The org.eclipse.uml2.uml.resource contains code behind the
> > migration. ( you might want to have a look at the migration guide
> from the
> > UML wiki .. it explains the mapping in a human readable format ).
> I stumbled over it some weeks ago but skipped it because I thought it has
> nothing to do with my problem. So I'm definitly going to take a look on it
> soon. Thanks for the hint.
>
> > There are draft articles for creating DSL in bugzilla [77413], and links
> > from the UML wiki.
> > You might also want to have a look at the UMLTools project for creating
> > editors for your own metamodel.
> I already looked at both. I played around with Heavyweight-Extensions but
> it seemed preety much that other UML Tools e.g. MagicDraw won't handle
> heavyweight extensions at all. So customizing the UML editor of UMLTools
> is not an option neither.
>
> I found an error in my first post:
> "Now my experiments showed that the heavyweigth extensions in which I
> extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant. So
> the only way to customize uml and still be able to use standard uml tools
> is the lightweight approach."
>
> thanks so far
> -stefan
>
>
>
>>
>> Hope that helps,
>>
>> - James.
>>
>>
>> "SKuhn" <kuhn@oio.de> wrote in message
>> news:f4jhq2$76t$1@build.eclipse.org...
>>> Hi Ed,
>>>
>>> I expressed my hopes with "So it would be really nice to start a
>>> discussion about them or if you say just read this f****** manual
>>> because I'm stuck right now ;( " in a way that people can say I did it
>>> this way or this way is really awful/awesome or this is the best way to
>>> do it.
>>>
>>> and later on my 'question' in the last point "I'm wondering where I can
>>> find good resources about that or if there isn't a simple
>>> proof-of-concept example somewhere.".
>>>
>>> Anyway, the question-representation looks like this:
>>> Does anybody know good resources which may help me realizing My
>>> Favourite approach(the last) point under EcoreMapping?
>>>
>>> I can't imagine that this is a new problem/approach, so is there already
>>> a proof-of-concept example somewhere?
>>>
>>> > I does sound like it would be
>>> > perhaps a lot simpler to design your own independent model that has
>>> no
>>> > relation to UML2
>>> Of course ;). My problem is that I somehow need this representation in
>>> UML (I described this in Use Case).
>>>
>>> greets
>>> stefan
>>>
>>>
>>>
>>>
>>>
>>> Ed Merks schrieb:
>>>> Stefan,
>>>>
>>>> It is indeed a long post and I actually can't find a single "?" in it,
>>>> so I'm not really sure what to say. , but I don't think I really
>> understood well all the
>>>> issues and concerns...
>>>>
>>>>
>>>> SKuhn wrote:
>>>>> hi folks,
>>>>>
>>>>> the following text is quite long, so if you're in a rush just read
>>>>> abstract, look at the picture, read constraints, the idea and the last
>>>>> point of ecore-mapping.
>>>>>
>>>>> Abstract:
>>>>> basically I want to be able to read & write proper UML2 models with my
>>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>>> going to outline it in detail because I didn't find a good way to
>>>>> start / solve it.
>>>>>
>>>>> Use Case:
>>>>> We're working with MDSD and already have a cardridge for a domain.
>>>>> Right now, the generator gets the model from an uml2 tool. The
>>>>> graphical editor I have to make (using GMF) for this domain should be
>>>>> able to read and write uml2 models because of reasons like flexibility
>>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>>> generator accept uml2 models from ecore.
>>>>>
>>>>> DSL:
>>>>> There various reasons why a tend to create my own domain specific
>>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>>> uml2.ecore:
>>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>>> based on the uml2.ecore with several hundred classes.
>>>>> * not that error prone because less confusion for the GMF framework
>>>>> and even more important for me.
>>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>>> the others should be easier to write on a simple MM.
>>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>>> I stopped the generation).
>>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>>> than building a customized UML2 editor.
>>>>>
>>>>> The two worlds:
>>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>>> picture). In the left corner, we see famous UML with his well known
>>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>>> also with metaclasses described in ecore. Now my experiments showed
>>>>> that the heavyweigth extensions in which I extended classes from the
>>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>>> and still be able to use standard uml tools is the lightweight
>>>>> approach. I sketched this with the outer circle around uml.
>>>>>
>>>>> Contraints:
>>>>> * I assume that I'm not restricting UML and
>>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>>> expressable by stereotypes.
>>>>> * both MM are defined in EMF.
>>>>>
>>>>> The idea:
>>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>>> instances of both MM. So on the right we can see the instance classes
>>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>>> example this would result in mapping:
>>>>> * an instance of container to an uml-package with sterotype
>> dsl-container
>>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>>> sterotype dsl-class#1
>>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>>> sterotype dsl-class#1
>>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>>> be stereotyped as "dsl-association if easier)
>>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>>> sterotype dsl-class#2
>>>>>
>>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>>> time):
>>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>>> for the classic reasons e.g. consistency between the models,
>>>>> overwriting or synchronization of changes and -for me the most
>>>>> important one- possible information loss due to the lack of
>>>>> representation in one language. In my example this means that if a
>>>>> "NotDslClass" exists in the left UML world for which I have no
>>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>>> I guess I would be forced to handle it somehow not to loose
>>>>> information in the back-to-uml transformation.
>>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>>> also seems error prone and seems to require a good knowledge of
>> XMI,too.
>>>>> Ecore Mapping:
>>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>>> editor but actually work directly on an UML model. I found the EMF
>>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>>> found the some starting points or ideas how to realize it. My problem
>>>>> is I can hardly value them nor I know a kind of best practice for
>>>>> this. So it would be really nice to start a discussion about them or
>>>>> if you say just read this f****** manual because I'm stuck right now
>>>>> ;(
>>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>>> looks like an option but my impression is that this is not really what
>>>>> I want.
>>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>>> work implying a pretty good understanding of EMF.
>>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>>> here is that it's just mentioned and not really described, but it
>>>>> seems exactly like what I want. This feeling is emphazied by features
>>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>>> resources about that or if there isn't a simple proof-of-concept
>>>>> example somewhere.
>>>>>
>>>>> Thanks for reading already
>>>>> -stefan
>>>>>
>>>>>
>>>> ------------------------------------------------------------ ------------
>>

SKuhn schrieb:
> hi folks,
>
> the following text is quite long, so if you're in a rush just read
> abstract, look at the picture, read constraints, the idea and the last
> point of ecore-mapping.
>
> Abstract:
> basically I want to be able to read & write proper UML2 models with my
> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> going to outline it in detail because I didn't find a good way to start
> / solve it.
>
> Use Case:
> We're working with MDSD and already have a cardridge for a domain. Right
> now, the generator gets the model from an uml2 tool. The graphical
> editor I have to make (using GMF) for this domain should be able to read
> and write uml2 models because of reasons like flexibility (wheather or
> not to use my editor) or extended control of an uml tool (e.g to model
> the DTOs in the same file). Both, UML2 Tools and the generator accept
> uml2 models from ecore.
>
> DSL:
> There various reasons why a tend to create my own domain specific
> language (DSL) for my graphical editor (GE) in contrast to use uml2.ecore:
> * a DSL which uses around 10 classes seems to be overburdened if it's
> based on the uml2.ecore with several hundred classes.
> * not that error prone because less confusion for the GMF framework and
> even more important for me.
> * some constraints are already implicit from my DSL Metamodel (MM) and
> the others should be easier to write on a simple MM.
> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
> stopped the generation).
> * there must be a reason why GMF enforces the creation of DSLs rather
> than building a customized UML2 editor.
>
> The two worlds:
> This results in two worlds for my "MetaModel" sketch (see attached
> picture). In the left corner, we see famous UML with his well known
> metaclasses and packages. On the right corner we can see the young DSL
> also with metaclasses described in ecore. Now my experiments showed that
> the heavyweigth extensions in which I extended classes from the
> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
> still be able to use standard uml tools is the lightweight approach. I
> sketched this with the outer circle around uml.
>
> Contraints:
> * I assume that I'm not restricting UML and
> * that every DSL Class has a pendant in uml with a lack of semantics
> expressable by stereotypes.
> * both MM are defined in EMF.
>
> The idea:
> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> creating a profile with sterotypes and enumerations for my DSL and
> represent my DSL classes in uml with the appropriate stereotype. I
> illustrated this in the 2nd picture "Concrete example" which shows
> instances of both MM. So on the right we can see the instance classes of
> MyDSL: a container, a class named Ex1 which is an instance of
> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> association between Ex1 and Ex2 and a class named Ex3 which is an
> instance of DSL-Class#2. Now I want to map them to UML. Following my
> example this would result in mapping:
> * an instance of container to an uml-package with sterotype dsl-container
> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> sterotype dsl-class#1
> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> sterotype dsl-class#1
> * an association between Ex1 and Ex2 to an uml association (which may be
> stereotyped as "dsl-association if easier)
> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> sterotype dsl-class#2
>
> Other Mapping possibilities (mentioned if my vision doesn't work in time):
> * Model-to-Model transformation is an option. I rather dislike this for
> the classic reasons e.g. consistency between the models, overwriting or
> synchronization of changes and -for me the most important one- possible
> information loss due to the lack of representation in one language. In
> my example this means that if a "NotDslClass" exists in the left UML
> world for which I have no representation in MyDSL there is no need to
> represent it in MyDSL. But I guess I would be forced to handle it
> somehow not to loose information in the back-to-uml transformation.
> * Customized XML/XMI serialization through extending the XMLHelper also
> seems error prone and seems to require a good knowledge of XMI,too.
>
> Ecore Mapping:
> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> editor but actually work directly on an UML model. I found the EMF part
> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> found the some starting points or ideas how to realize it. My problem is
> I can hardly value them nor I know a kind of best practice for this. So
> it would be really nice to start a discussion about them or if you say
> just read this f****** manual because I'm stuck right now ;(
> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
> like an option but my impression is that this is not really what I want.
> * Abuse the Model classes (or facades), normally generated by generate
> model code as an adapter to eclipse-uml2 facades seems like a lot of
> work implying a pretty good understanding of EMF.
> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
> it's just mentioned and not really described, but it seems exactly like
> what I want. This feeling is emphazied by features like
> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> resources about that or if there isn't a simple proof-of-concept example
> somewhere.
>
> Thanks for reading already
> -stefan
>
>
> ------------------------------------------------------------ ------------
>

Marco Mosconi schrieb:
> Hi,
>
> I didn't read through the whole post, but if you just want to bridge
> your DSL with UML2 Profiles, perhaps the following is exactly what you
> want:
> http://www.eclipse.org/gmt/amw/usecases/umlprofiles/
>
> Regards,
> Marco
>
> SKuhn schrieb:
>> hi folks,
>>
>> the following text is quite long, so if you're in a rush just read
>> abstract, look at the picture, read constraints, the idea and the last
>> point of ecore-mapping.
>>
>> Abstract:
>> basically I want to be able to read & write proper UML2 models with my
>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>> going to outline it in detail because I didn't find a good way to
>> start / solve it.
>>
>> Use Case:
>> We're working with MDSD and already have a cardridge for a domain.
>> Right now, the generator gets the model from an uml2 tool. The
>> graphical editor I have to make (using GMF) for this domain should be
>> able to read and write uml2 models because of reasons like flexibility
>> (wheather or not to use my editor) or extended control of an uml tool
>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>> generator accept uml2 models from ecore.
>>
>> DSL:
>> There various reasons why a tend to create my own domain specific
>> language (DSL) for my graphical editor (GE) in contrast to use
>> uml2.ecore:
>> * a DSL which uses around 10 classes seems to be overburdened if it's
>> based on the uml2.ecore with several hundred classes.
>> * not that error prone because less confusion for the GMF framework
>> and even more important for me.
>> * some constraints are already implicit from my DSL Metamodel (MM) and
>> the others should be easier to write on a simple MM.
>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>> I stopped the generation).
>> * there must be a reason why GMF enforces the creation of DSLs rather
>> than building a customized UML2 editor.
>>
>> The two worlds:
>> This results in two worlds for my "MetaModel" sketch (see attached
>> picture). In the left corner, we see famous UML with his well known
>> metaclasses and packages. On the right corner we can see the young DSL
>> also with metaclasses described in ecore. Now my experiments showed
>> that the heavyweigth extensions in which I extended classes from the
>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>> and still be able to use standard uml tools is the lightweight
>> approach. I sketched this with the outer circle around uml.
>>
>> Contraints:
>> * I assume that I'm not restricting UML and
>> * that every DSL Class has a pendant in uml with a lack of semantics
>> expressable by stereotypes.
>> * both MM are defined in EMF.
>>
>> The idea:
>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>> creating a profile with sterotypes and enumerations for my DSL and
>> represent my DSL classes in uml with the appropriate stereotype. I
>> illustrated this in the 2nd picture "Concrete example" which shows
>> instances of both MM. So on the right we can see the instance classes
>> of MyDSL: a container, a class named Ex1 which is an instance of
>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>> association between Ex1 and Ex2 and a class named Ex3 which is an
>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>> example this would result in mapping:
>> * an instance of container to an uml-package with sterotype dsl-container
>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>> sterotype dsl-class#1
>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>> sterotype dsl-class#1
>> * an association between Ex1 and Ex2 to an uml association (which may
>> be stereotyped as "dsl-association if easier)
>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>> sterotype dsl-class#2
>>
>> Other Mapping possibilities (mentioned if my vision doesn't work in
>> time):
>> * Model-to-Model transformation is an option. I rather dislike this
>> for the classic reasons e.g. consistency between the models,
>> overwriting or synchronization of changes and -for me the most
>> important one- possible information loss due to the lack of
>> representation in one language. In my example this means that if a
>> "NotDslClass" exists in the left UML world for which I have no
>> representation in MyDSL there is no need to represent it in MyDSL. But
>> I guess I would be forced to handle it somehow not to loose
>> information in the back-to-uml transformation.
>> * Customized XML/XMI serialization through extending the XMLHelper
>> also seems error prone and seems to require a good knowledge of XMI,too.
>>
>> Ecore Mapping:
>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>> editor but actually work directly on an UML model. I found the EMF
>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>> found the some starting points or ideas how to realize it. My problem
>> is I can hardly value them nor I know a kind of best practice for
>> this. So it would be really nice to start a discussion about them or
>> if you say just read this f****** manual because I'm stuck right now ;(
>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>> looks like an option but my impression is that this is not really what
>> I want.
>> * Abuse the Model classes (or facades), normally generated by generate
>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>> work implying a pretty good understanding of EMF.
>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>> here is that it's just mentioned and not really described, but it
>> seems exactly like what I want. This feeling is emphazied by features
>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>> resources about that or if there isn't a simple proof-of-concept
>> example somewhere.
>>
>> Thanks for reading already
>> -stefan
>>
>>
>> ------------------------------------------------------------ ------------
>>

> You must facilitate modeling of instances of your DSL in your Tool.
> You must interoperate with UML tools.
right.

I've got some concerns about M2M Transformation:
* Possible data loss, because my target model (MyDSL) doensn't represent
all the elements I have in my source model (e.g. UML+Profile). (main
concern)
* It looks like my problem already is adressed with ecore2ecore (using
the OPTION_RECORD_UNKNOWN_FEATURE) with pre/post-processing the data
with an recource handler.
* M2M implies addional overhead, serverals RecourceSets and I guess no
chance for event based handling (this would result in sync 'models', so
I can use eclipse with MyGui4MyDSL and the eclipse UML2 modelling tools
at the same time) (this point is -of course- just nice to have).

cheers
stefan

Antonio Carrasco schrieb:
> My 2 cents:
>
> Two forces:
> You must facilitate modeling of instances of your DSL in your Tool.
> You must interoperate with UML tools.
>
> Deal with them separately:
>
> Do your custom DSL editor, i.e. with GMF
> Convert to/from Eclipse UML2.1 with Model2Model transformations,
> Save UML2 interoperable .xmi files from Eclipse UML2.1
> (some tools will not interoperate with the default .xmi from Eclipse)
> Keep asking, to figure out how to interoperate with Diagrams
> from other tools.
>
> Cheers,
> Antonio
>
>
>
>
>
>
>
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jtnn$d33$1@build.eclipse.org...
>> hi james,
>>
>>> For an example of the ecore2ecore mapping have a look at
>>> org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
>> This
>>> is a mapping between older and newer verion of UML and is used for
>> forward
>>> migration. The org.eclipse.uml2.uml.resource contains code behind the
>>> migration. ( you might want to have a look at the migration guide
>> from the
>>> UML wiki .. it explains the mapping in a human readable format ).
>> I stumbled over it some weeks ago but skipped it because I thought it has
>> nothing to do with my problem. So I'm definitly going to take a look on it
>> soon. Thanks for the hint.
>>
>>> There are draft articles for creating DSL in bugzilla [77413], and links
>>> from the UML wiki.
>>> You might also want to have a look at the UMLTools project for creating
>>> editors for your own metamodel.
>> I already looked at both. I played around with Heavyweight-Extensions but
>> it seemed preety much that other UML Tools e.g. MagicDraw won't handle
>> heavyweight extensions at all. So customizing the UML editor of UMLTools
>> is not an option neither.
>>
>> I found an error in my first post:
>> "Now my experiments showed that the heavyweigth extensions in which I
>> extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant. So
>> the only way to customize uml and still be able to use standard uml tools
>> is the lightweight approach."
>>
>> thanks so far
>> -stefan
>>
>>
>>
>>> Hope that helps,
>>>
>>> - James.
>>>
>>>
>>> "SKuhn" <kuhn@oio.de> wrote in message
>>> news:f4jhq2$76t$1@build.eclipse.org...
>>>> Hi Ed,
>>>>
>>>> I expressed my hopes with "So it would be really nice to start a
>>>> discussion about them or if you say just read this f****** manual
>>>> because I'm stuck right now ;( " in a way that people can say I did it
>>>> this way or this way is really awful/awesome or this is the best way to
>>>> do it.
>>>>
>>>> and later on my 'question' in the last point "I'm wondering where I can
>>>> find good resources about that or if there isn't a simple
>>>> proof-of-concept example somewhere.".
>>>>
>>>> Anyway, the question-representation looks like this:
>>>> Does anybody know good resources which may help me realizing My
>>>> Favourite approach(the last) point under EcoreMapping?
>>>>
>>>> I can't imagine that this is a new problem/approach, so is there already
>>>> a proof-of-concept example somewhere?
>>>>
>>>> > I does sound like it would be
>>>> > perhaps a lot simpler to design your own independent model that has
>>>> no
>>>> > relation to UML2
>>>> Of course ;). My problem is that I somehow need this representation in
>>>> UML (I described this in Use Case).
>>>>
>>>> greets
>>>> stefan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Ed Merks schrieb:
>>>>> Stefan,
>>>>>
>>>>> It is indeed a long post and I actually can't find a single "?" in it,
>>>>> so I'm not really sure what to say. , but I don't think I really
>>> understood well all the
>>>>> issues and concerns...
>>>>>
>>>>>
>>>>> SKuhn wrote:
>>>>>> hi folks,
>>>>>>
>>>>>> the following text is quite long, so if you're in a rush just read
>>>>>> abstract, look at the picture, read constraints, the idea and the last
>>>>>> point of ecore-mapping.
>>>>>>
>>>>>> Abstract:
>>>>>> basically I want to be able to read & write proper UML2 models with my
>>>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>>>> going to outline it in detail because I didn't find a good way to
>>>>>> start / solve it.
>>>>>>
>>>>>> Use Case:
>>>>>> We're working with MDSD and already have a cardridge for a domain.
>>>>>> Right now, the generator gets the model from an uml2 tool. The
>>>>>> graphical editor I have to make (using GMF) for this domain should be
>>>>>> able to read and write uml2 models because of reasons like flexibility
>>>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>>>> generator accept uml2 models from ecore.
>>>>>>
>>>>>> DSL:
>>>>>> There various reasons why a tend to create my own domain specific
>>>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>>>> uml2.ecore:
>>>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>>>> based on the uml2.ecore with several hundred classes.
>>>>>> * not that error prone because less confusion for the GMF framework
>>>>>> and even more important for me.
>>>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>>>> the others should be easier to write on a simple MM.
>>>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>>>> I stopped the generation).
>>>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>>>> than building a customized UML2 editor.
>>>>>>
>>>>>> The two worlds:
>>>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>>>> picture). In the left corner, we see famous UML with his well known
>>>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>>>> also with metaclasses described in ecore. Now my experiments showed
>>>>>> that the heavyweigth extensions in which I extended classes from the
>>>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>>>> and still be able to use standard uml tools is the lightweight
>>>>>> approach. I sketched this with the outer circle around uml.
>>>>>>
>>>>>> Contraints:
>>>>>> * I assume that I'm not restricting UML and
>>>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>>>> expressable by stereotypes.
>>>>>> * both MM are defined in EMF.
>>>>>>
>>>>>> The idea:
>>>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>>>> instances of both MM. So on the right we can see the instance classes
>>>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>>>> example this would result in mapping:
>>>>>> * an instance of container to an uml-package with sterotype
>>> dsl-container
>>>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>>>> sterotype dsl-class#1
>>>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>>>> sterotype dsl-class#1
>>>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>>>> be stereotyped as "dsl-association if easier)
>>>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>>>> sterotype dsl-class#2
>>>>>>
>>>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>>>> time):
>>>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>>>> for the classic reasons e.g. consistency between the models,
>>>>>> overwriting or synchronization of changes and -for me the most
>>>>>> important one- possible information loss due to the lack of
>>>>>> representation in one language. In my example this means that if a
>>>>>> "NotDslClass" exists in the left UML world for which I have no
>>>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>>>> I guess I would be forced to handle it somehow not to loose
>>>>>> information in the back-to-uml transformation.
>>>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>>>> also seems error prone and seems to require a good knowledge of
>>> XMI,too.
>>>>>> Ecore Mapping:
>>>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>>>> editor but actually work directly on an UML model. I found the EMF
>>>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>>>> found the some starting points or ideas how to realize it. My problem
>>>>>> is I can hardly value them nor I know a kind of best practice for
>>>>>> this. So it would be really nice to start a discussion about them or
>>>>>> if you say just read this f****** manual because I'm stuck right now
>>>>>> ;(
>>>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>>>> looks like an option but my impression is that this is not really what
>>>>>> I want.
>>>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>>>> work implying a pretty good understanding of EMF.
>>>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>>>> here is that it's just mentioned and not really described, but it
>>>>>> seems exactly like what I want. This feeling is emphazied by features
>>>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>>>> resources about that or if there isn't a simple proof-of-concept
>>>>>> example somewhere.
>>>>>>
>>>>>> Thanks for reading already
>>>>>> -stefan
>>>>>>
>>>>>>
>>>>> ------------------------------------------------------------ ------------
>

Several of the approaches you describe seem valid. A major difference (an
perhaps a deciding factor) between them seems (to me) to be whether
synchronization between the two domains (your DSL and UML, which
incidentally can also be viewed as a DSL) happens dynamically (at the
in-memory object representation level) or only when a resource is
serialized/deserialized.

The Ecore2Ecore model was designed as a mechanism to describe simple
mappings between two arbitrary EMF (Ecore) models. Ecore2XML was introduced
to provide an alternative representation of suuch mappings that is tailored
to (de)serialization in XML/XMI. In practice, Ecore2XML is really only
useful for mapping between two models that are similar in structure - as
James has mentioned, it is being used successfully in UML2 to migrate models
between different versions of UML. Note that complex mappings still need to
be handled using custom resource handlers and/or post processors (as
described in the advanced EMF tutorials from EclipseCon 2006 and 2007).
Beyond the EMF tutorials, perhaps the best source of information is the
source code. James has already provided you with pointers to the releated
classes in UML2... has this been of some help?

Kenn

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jhq2$76t$1@build.eclipse.org...
> Hi Ed,
>
> I expressed my hopes with "So it would be really nice to start a
> discussion about them or if you say just read this f****** manual because
> I'm stuck right now ;( " in a way that people can say I did it this way
> or this way is really awful/awesome or this is the best way to do it.
>
> and later on my 'question' in the last point "I'm wondering where I can
> find good resources about that or if there isn't a simple proof-of-concept
> example somewhere.".
>
> Anyway, the question-representation looks like this:
> Does anybody know good resources which may help me realizing My Favourite
> approach(the last) point under EcoreMapping?
>
> I can't imagine that this is a new problem/approach, so is there already a
> proof-of-concept example somewhere?
>
> > I does sound like it would be
> > perhaps a lot simpler to design your own independent model that has no
> > relation to UML2
> Of course ;). My problem is that I somehow need this representation in UML
> (I described this in Use Case).
>
> greets
> stefan
>
>
>
>
>
> Ed Merks schrieb:
>> Stefan,
>>
>> It is indeed a long post and I actually can't find a single "?" in it, so
>> I'm not really sure what to say. , but I don't think I really understood
>> well all the issues and concerns...
>>
>>
>> SKuhn wrote:
>>> hi folks,
>>>
>>> the following text is quite long, so if you're in a rush just read
>>> abstract, look at the picture, read constraints, the idea and the last
>>> point of ecore-mapping.
>>>
>>> Abstract:
>>> basically I want to be able to read & write proper UML2 models with my
>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>> going to outline it in detail because I didn't find a good way to start
>>> / solve it.
>>>
>>> Use Case:
>>> We're working with MDSD and already have a cardridge for a domain. Right
>>> now, the generator gets the model from an uml2 tool. The graphical
>>> editor I have to make (using GMF) for this domain should be able to read
>>> and write uml2 models because of reasons like flexibility (wheather or
>>> not to use my editor) or extended control of an uml tool (e.g to model
>>> the DTOs in the same file). Both, UML2 Tools and the generator accept
>>> uml2 models from ecore.
>>>
>>> DSL:
>>> There various reasons why a tend to create my own domain specific
>>> language (DSL) for my graphical editor (GE) in contrast to use
>>> uml2.ecore:
>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>> based on the uml2.ecore with several hundred classes.
>>> * not that error prone because less confusion for the GMF framework and
>>> even more important for me.
>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>> the others should be easier to write on a simple MM.
>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
>>> stopped the generation).
>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>> than building a customized UML2 editor.
>>>
>>> The two worlds:
>>> This results in two worlds for my "MetaModel" sketch (see attached
>>> picture). In the left corner, we see famous UML with his well known
>>> metaclasses and packages. On the right corner we can see the young DSL
>>> also with metaclasses described in ecore. Now my experiments showed that
>>> the heavyweigth extensions in which I extended classes from the
>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
>>> still be able to use standard uml tools is the lightweight approach. I
>>> sketched this with the outer circle around uml.
>>>
>>> Contraints:
>>> * I assume that I'm not restricting UML and
>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>> expressable by stereotypes.
>>> * both MM are defined in EMF.
>>>
>>> The idea:
>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>> creating a profile with sterotypes and enumerations for my DSL and
>>> represent my DSL classes in uml with the appropriate stereotype. I
>>> illustrated this in the 2nd picture "Concrete example" which shows
>>> instances of both MM. So on the right we can see the instance classes of
>>> MyDSL: a container, a class named Ex1 which is an instance of
>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>> example this would result in mapping:
>>> * an instance of container to an uml-package with sterotype
>>> dsl-container
>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>> sterotype dsl-class#1
>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>> sterotype dsl-class#1
>>> * an association between Ex1 and Ex2 to an uml association (which may be
>>> stereotyped as "dsl-association if easier)
>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>> sterotype dsl-class#2
>>>
>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>> time):
>>> * Model-to-Model transformation is an option. I rather dislike this for
>>> the classic reasons e.g. consistency between the models, overwriting or
>>> synchronization of changes and -for me the most important one- possible
>>> information loss due to the lack of representation in one language. In
>>> my example this means that if a "NotDslClass" exists in the left UML
>>> world for which I have no representation in MyDSL there is no need to
>>> represent it in MyDSL. But I guess I would be forced to handle it
>>> somehow not to loose information in the back-to-uml transformation.
>>> * Customized XML/XMI serialization through extending the XMLHelper also
>>> seems error prone and seems to require a good knowledge of XMI,too.
>>>
>>> Ecore Mapping:
>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>> editor but actually work directly on an UML model. I found the EMF part
>>> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>> found the some starting points or ideas how to realize it. My problem is
>>> I can hardly value them nor I know a kind of best practice for this. So
>>> it would be really nice to start a discussion about them or if you say
>>> just read this f****** manual because I'm stuck right now ;(
>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
>>> like an option but my impression is that this is not really what I want.
>>> * Abuse the Model classes (or facades), normally generated by generate
>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>> work implying a pretty good understanding of EMF.
>>> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
>>> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
>>> it's just mentioned and not really described, but it seems exactly like
>>> what I want. This feeling is emphazied by features like
>>> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>> resources about that or if there isn't a simple proof-of-concept example
>>> somewhere.
>>>
>>> Thanks for reading already
>>> -stefan
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>

Honestly I have the feeling that there is no really good solution. I
ended up with the decicion to implement a DSL->UML2 M2M transformation
with xTend (oAW, because GMF already uses xPand and they're similar).
I'm running out of time, so I have no space left for experiments ;(.
Thanks for your reply anyway.

Kenn Hussey schrieb:
> Stefan,
>
> Several of the approaches you describe seem valid. A major difference (an
> perhaps a deciding factor) between them seems (to me) to be whether
> synchronization between the two domains (your DSL and UML, which
> incidentally can also be viewed as a DSL) happens dynamically (at the
> in-memory object representation level) or only when a resource is
> serialized/deserialized.
>
> The Ecore2Ecore model was designed as a mechanism to describe simple
> mappings between two arbitrary EMF (Ecore) models. Ecore2XML was introduced
> to provide an alternative representation of suuch mappings that is tailored
> to (de)serialization in XML/XMI. In practice, Ecore2XML is really only
> useful for mapping between two models that are similar in structure - as
> James has mentioned, it is being used successfully in UML2 to migrate models
> between different versions of UML. Note that complex mappings still need to
> be handled using custom resource handlers and/or post processors (as
> described in the advanced EMF tutorials from EclipseCon 2006 and 2007).
> Beyond the EMF tutorials, perhaps the best source of information is the
> source code. James has already provided you with pointers to the releated
> classes in UML2... has this been of some help?
>
> Kenn
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jhq2$76t$1@build.eclipse.org...
>> Hi Ed,
>>
>> I expressed my hopes with "So it would be really nice to start a
>> discussion about them or if you say just read this f****** manual because
>> I'm stuck right now ;( " in a way that people can say I did it this way
>> or this way is really awful/awesome or this is the best way to do it.
>>
>> and later on my 'question' in the last point "I'm wondering where I can
>> find good resources about that or if there isn't a simple proof-of-concept
>> example somewhere.".
>>
>> Anyway, the question-representation looks like this:
>> Does anybody know good resources which may help me realizing My Favourite
>> approach(the last) point under EcoreMapping?
>>
>> I can't imagine that this is a new problem/approach, so is there already a
>> proof-of-concept example somewhere?
>>
>>> I does sound like it would be
>>> perhaps a lot simpler to design your own independent model that has no
>>> relation to UML2
>> Of course ;). My problem is that I somehow need this representation in UML
>> (I described this in Use Case).
>>
>> greets
>> stefan
>>
>>
>>
>>
>>
>> Ed Merks schrieb:
>>> Stefan,
>>>
>>> It is indeed a long post and I actually can't find a single "?" in it, so
>>> I'm not really sure what to say. , but I don't think I really understood
>>> well all the issues and concerns...
>>>
>>>
>>> SKuhn wrote:
>>>> hi folks,
>>>>
>>>> the following text is quite long, so if you're in a rush just read
>>>> abstract, look at the picture, read constraints, the idea and the last
>>>> point of ecore-mapping.
>>>>
>>>> Abstract:
>>>> basically I want to be able to read & write proper UML2 models with my
>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>> going to outline it in detail because I didn't find a good way to start
>>>> / solve it.
>>>>
>>>> Use Case:
>>>> We're working with MDSD and already have a cardridge for a domain. Right
>>>> now, the generator gets the model from an uml2 tool. The graphical
>>>> editor I have to make (using GMF) for this domain should be able to read
>>>> and write uml2 models because of reasons like flexibility (wheather or
>>>> not to use my editor) or extended control of an uml tool (e.g to model
>>>> the DTOs in the same file). Both, UML2 Tools and the generator accept
>>>> uml2 models from ecore.
>>>>
>>>> DSL:
>>>> There various reasons why a tend to create my own domain specific
>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>> uml2.ecore:
>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>> based on the uml2.ecore with several hundred classes.
>>>> * not that error prone because less confusion for the GMF framework and
>>>> even more important for me.
>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>> the others should be easier to write on a simple MM.
>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
>>>> stopped the generation).
>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>> than building a customized UML2 editor.
>>>>
>>>> The two worlds:
>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>> picture). In the left corner, we see famous UML with his well known
>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>> also with metaclasses described in ecore. Now my experiments showed that
>>>> the heavyweigth extensions in which I extended classes from the
>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
>>>> still be able to use standard uml tools is the lightweight approach. I
>>>> sketched this with the outer circle around uml.
>>>>
>>>> Contraints:
>>>> * I assume that I'm not restricting UML and
>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>> expressable by stereotypes.
>>>> * both MM are defined in EMF.
>>>>
>>>> The idea:
>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>> instances of both MM. So on the right we can see the instance classes of
>>>> MyDSL: a container, a class named Ex1 which is an instance of
>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>> example this would result in mapping:
>>>> * an instance of container to an uml-package with sterotype
>>>> dsl-container
>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>> sterotype dsl-class#1
>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>> sterotype dsl-class#1
>>>> * an association between Ex1 and Ex2 to an uml association (which may be
>>>> stereotyped as "dsl-association if easier)
>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>> sterotype dsl-class#2
>>>>
>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>> time):
>>>> * Model-to-Model transformation is an option. I rather dislike this for
>>>> the classic reasons e.g. consistency between the models, overwriting or
>>>> synchronization of changes and -for me the most important one- possible
>>>> information loss due to the lack of representation in one language. In
>>>> my example this means that if a "NotDslClass" exists in the left UML
>>>> world for which I have no representation in MyDSL there is no need to
>>>> represent it in MyDSL. But I guess I would be forced to handle it
>>>> somehow not to loose information in the back-to-uml transformation.
>>>> * Customized XML/XMI serialization through extending the XMLHelper also
>>>> seems error prone and seems to require a good knowledge of XMI,too.
>>>>
>>>> Ecore Mapping:
>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>> editor but actually work directly on an UML model. I found the EMF part
>>>> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>> found the some starting points or ideas how to realize it. My problem is
>>>> I can hardly value them nor I know a kind of best practice for this. So
>>>> it would be really nice to start a discussion about them or if you say
>>>> just read this f****** manual because I'm stuck right now ;(
>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
>>>> like an option but my impression is that this is not really what I want.
>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>> work implying a pretty good understanding of EMF.
>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
>>>> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
>>>> it's just mentioned and not really described, but it seems exactly like
>>>> what I want. This feeling is emphazied by features like
>>>> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>> resources about that or if there isn't a simple proof-of-concept example
>>>> somewhere.
>>>>
>>>> Thanks for reading already
>>>> -stefan
>>>>
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>
>

It is indeed a long post and I actually can't find a single "?" in it,
so I'm not really sure what to say. I does sound like it would be
perhaps a lot simpler to design your own independent model that has no
relation to UML2, but I don't think I really understood well all the
issues and concerns...

SKuhn wrote:
> hi folks,
>
> the following text is quite long, so if you're in a rush just read
> abstract, look at the picture, read constraints, the idea and the last
> point of ecore-mapping.
>
> Abstract:
> basically I want to be able to read & write proper UML2 models with my
> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> going to outline it in detail because I didn't find a good way to
> start / solve it.
>
> Use Case:
> We're working with MDSD and already have a cardridge for a domain.
> Right now, the generator gets the model from an uml2 tool. The
> graphical editor I have to make (using GMF) for this domain should be
> able to read and write uml2 models because of reasons like flexibility
> (wheather or not to use my editor) or extended control of an uml tool
> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
> generator accept uml2 models from ecore.
>
> DSL:
> There various reasons why a tend to create my own domain specific
> language (DSL) for my graphical editor (GE) in contrast to use
> uml2.ecore:
> * a DSL which uses around 10 classes seems to be overburdened if it's
> based on the uml2.ecore with several hundred classes.
> * not that error prone because less confusion for the GMF framework
> and even more important for me.
> * some constraints are already implicit from my DSL Metamodel (MM) and
> the others should be easier to write on a simple MM.
> * It seems unhandy to create the uml2.ecore model code (after 5 hours
> I stopped the generation).
> * there must be a reason why GMF enforces the creation of DSLs rather
> than building a customized UML2 editor.
>
> The two worlds:
> This results in two worlds for my "MetaModel" sketch (see attached
> picture). In the left corner, we see famous UML with his well known
> metaclasses and packages. On the right corner we can see the young DSL
> also with metaclasses described in ecore. Now my experiments showed
> that the heavyweigth extensions in which I extended classes from the
> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
> and still be able to use standard uml tools is the lightweight
> approach. I sketched this with the outer circle around uml.
>
> Contraints:
> * I assume that I'm not restricting UML and
> * that every DSL Class has a pendant in uml with a lack of semantics
> expressable by stereotypes.
> * both MM are defined in EMF.
>
> The idea:
> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> creating a profile with sterotypes and enumerations for my DSL and
> represent my DSL classes in uml with the appropriate stereotype. I
> illustrated this in the 2nd picture "Concrete example" which shows
> instances of both MM. So on the right we can see the instance classes
> of MyDSL: a container, a class named Ex1 which is an instance of
> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> association between Ex1 and Ex2 and a class named Ex3 which is an
> instance of DSL-Class#2. Now I want to map them to UML. Following my
> example this would result in mapping:
> * an instance of container to an uml-package with sterotype dsl-container
> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> sterotype dsl-class#1
> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> sterotype dsl-class#1
> * an association between Ex1 and Ex2 to an uml association (which may
> be stereotyped as "dsl-association if easier)
> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> sterotype dsl-class#2
>
> Other Mapping possibilities (mentioned if my vision doesn't work in
> time):
> * Model-to-Model transformation is an option. I rather dislike this
> for the classic reasons e.g. consistency between the models,
> overwriting or synchronization of changes and -for me the most
> important one- possible information loss due to the lack of
> representation in one language. In my example this means that if a
> "NotDslClass" exists in the left UML world for which I have no
> representation in MyDSL there is no need to represent it in MyDSL. But
> I guess I would be forced to handle it somehow not to loose
> information in the back-to-uml transformation.
> * Customized XML/XMI serialization through extending the XMLHelper
> also seems error prone and seems to require a good knowledge of XMI,too.
>
> Ecore Mapping:
> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> editor but actually work directly on an UML model. I found the EMF
> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> found the some starting points or ideas how to realize it. My problem
> is I can hardly value them nor I know a kind of best practice for
> this. So it would be really nice to start a discussion about them or
> if you say just read this f****** manual because I'm stuck right now ;(
> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
> looks like an option but my impression is that this is not really what
> I want.
> * Abuse the Model classes (or facades), normally generated by generate
> model code as an adapter to eclipse-uml2 facades seems like a lot of
> work implying a pretty good understanding of EMF.
> * My Favourite: to use the Ecore2Ecore mapper and a customized
> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
> here is that it's just mentioned and not really described, but it
> seems exactly like what I want. This feeling is emphazied by features
> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> resources about that or if there isn't a simple proof-of-concept
> example somewhere.
>
> Thanks for reading already
> -stefan
>
>
> ------------------------------------------------------------ ------------
>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Stefan,<br>
<br>
It is indeed a long post and I actually can't find a single "?" in it,
so I'm not really sure what to say.

I expressed my hopes with "So it would be really nice to start a
discussion about them or if you say just read this f****** manual
because I'm stuck right now ;( " in a way that people can say I did it
this way or this way is really awful/awesome or this is the best way to
do it.

and later on my 'question' in the last point "I'm wondering where I can
find good resources about that or if there isn't a simple
proof-of-concept example somewhere.".

Anyway, the question-representation looks like this:
Does anybody know good resources which may help me realizing My
Favourite approach(the last) point under EcoreMapping?

I can't imagine that this is a new problem/approach, so is there already
a proof-of-concept example somewhere?

> I does sound like it would be
> perhaps a lot simpler to design your own independent model that has no
> relation to UML2
Of course ;). My problem is that I somehow need this representation in
UML (I described this in Use Case).

greets
stefan

Ed Merks schrieb:
> Stefan,
>
> It is indeed a long post and I actually can't find a single "?" in it,
> so I'm not really sure what to say. , but I don't think I really understood well all the
> issues and concerns...
>
>
> SKuhn wrote:
>> hi folks,
>>
>> the following text is quite long, so if you're in a rush just read
>> abstract, look at the picture, read constraints, the idea and the last
>> point of ecore-mapping.
>>
>> Abstract:
>> basically I want to be able to read & write proper UML2 models with my
>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>> going to outline it in detail because I didn't find a good way to
>> start / solve it.
>>
>> Use Case:
>> We're working with MDSD and already have a cardridge for a domain.
>> Right now, the generator gets the model from an uml2 tool. The
>> graphical editor I have to make (using GMF) for this domain should be
>> able to read and write uml2 models because of reasons like flexibility
>> (wheather or not to use my editor) or extended control of an uml tool
>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>> generator accept uml2 models from ecore.
>>
>> DSL:
>> There various reasons why a tend to create my own domain specific
>> language (DSL) for my graphical editor (GE) in contrast to use
>> uml2.ecore:
>> * a DSL which uses around 10 classes seems to be overburdened if it's
>> based on the uml2.ecore with several hundred classes.
>> * not that error prone because less confusion for the GMF framework
>> and even more important for me.
>> * some constraints are already implicit from my DSL Metamodel (MM) and
>> the others should be easier to write on a simple MM.
>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>> I stopped the generation).
>> * there must be a reason why GMF enforces the creation of DSLs rather
>> than building a customized UML2 editor.
>>
>> The two worlds:
>> This results in two worlds for my "MetaModel" sketch (see attached
>> picture). In the left corner, we see famous UML with his well known
>> metaclasses and packages. On the right corner we can see the young DSL
>> also with metaclasses described in ecore. Now my experiments showed
>> that the heavyweigth extensions in which I extended classes from the
>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>> and still be able to use standard uml tools is the lightweight
>> approach. I sketched this with the outer circle around uml.
>>
>> Contraints:
>> * I assume that I'm not restricting UML and
>> * that every DSL Class has a pendant in uml with a lack of semantics
>> expressable by stereotypes.
>> * both MM are defined in EMF.
>>
>> The idea:
>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>> creating a profile with sterotypes and enumerations for my DSL and
>> represent my DSL classes in uml with the appropriate stereotype. I
>> illustrated this in the 2nd picture "Concrete example" which shows
>> instances of both MM. So on the right we can see the instance classes
>> of MyDSL: a container, a class named Ex1 which is an instance of
>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>> association between Ex1 and Ex2 and a class named Ex3 which is an
>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>> example this would result in mapping:
>> * an instance of container to an uml-package with sterotype dsl-container
>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>> sterotype dsl-class#1
>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>> sterotype dsl-class#1
>> * an association between Ex1 and Ex2 to an uml association (which may
>> be stereotyped as "dsl-association if easier)
>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>> sterotype dsl-class#2
>>
>> Other Mapping possibilities (mentioned if my vision doesn't work in
>> time):
>> * Model-to-Model transformation is an option. I rather dislike this
>> for the classic reasons e.g. consistency between the models,
>> overwriting or synchronization of changes and -for me the most
>> important one- possible information loss due to the lack of
>> representation in one language. In my example this means that if a
>> "NotDslClass" exists in the left UML world for which I have no
>> representation in MyDSL there is no need to represent it in MyDSL. But
>> I guess I would be forced to handle it somehow not to loose
>> information in the back-to-uml transformation.
>> * Customized XML/XMI serialization through extending the XMLHelper
>> also seems error prone and seems to require a good knowledge of XMI,too.
>>
>> Ecore Mapping:
>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>> editor but actually work directly on an UML model. I found the EMF
>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>> found the some starting points or ideas how to realize it. My problem
>> is I can hardly value them nor I know a kind of best practice for
>> this. So it would be really nice to start a discussion about them or
>> if you say just read this f****** manual because I'm stuck right now ;(
>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>> looks like an option but my impression is that this is not really what
>> I want.
>> * Abuse the Model classes (or facades), normally generated by generate
>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>> work implying a pretty good understanding of EMF.
>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>> here is that it's just mentioned and not really described, but it
>> seems exactly like what I want. This feeling is emphazied by features
>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>> resources about that or if there isn't a simple proof-of-concept
>> example somewhere.
>>
>> Thanks for reading already
>> -stefan
>>
>>
>> ------------------------------------------------------------ ------------
>>
>

For an example of the ecore2ecore mapping have a look at
org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml. This
is a mapping between older and newer verion of UML and is used for forward
migration. The org.eclipse.uml2.uml.resource contains code behind the
migration. ( you might want to have a look at the migration guide from the
UML wiki .. it explains the mapping in a human readable format ).

There are draft articles for creating DSL in bugzilla [77413], and links
from the UML wiki.

You might also want to have a look at the UMLTools project for creating
editors for your own metamodel.

Hope that helps,

- James.

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jhq2$76t$1@build.eclipse.org...
> Hi Ed,
>
> I expressed my hopes with "So it would be really nice to start a
> discussion about them or if you say just read this f****** manual
> because I'm stuck right now ;( " in a way that people can say I did it
> this way or this way is really awful/awesome or this is the best way to
> do it.
>
> and later on my 'question' in the last point "I'm wondering where I can
> find good resources about that or if there isn't a simple
> proof-of-concept example somewhere.".
>
> Anyway, the question-representation looks like this:
> Does anybody know good resources which may help me realizing My
> Favourite approach(the last) point under EcoreMapping?
>
> I can't imagine that this is a new problem/approach, so is there already
> a proof-of-concept example somewhere?
>
> > I does sound like it would be
> > perhaps a lot simpler to design your own independent model that has no
> > relation to UML2
> Of course ;). My problem is that I somehow need this representation in
> UML (I described this in Use Case).
>
> greets
> stefan
>
>
>
>
>
> Ed Merks schrieb:
> > Stefan,
> >
> > It is indeed a long post and I actually can't find a single "?" in it,
> > so I'm not really sure what to say. , but I don't think I really
understood well all the
> > issues and concerns...
> >
> >
> > SKuhn wrote:
> >> hi folks,
> >>
> >> the following text is quite long, so if you're in a rush just read
> >> abstract, look at the picture, read constraints, the idea and the last
> >> point of ecore-mapping.
> >>
> >> Abstract:
> >> basically I want to be able to read & write proper UML2 models with my
> >> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> >> going to outline it in detail because I didn't find a good way to
> >> start / solve it.
> >>
> >> Use Case:
> >> We're working with MDSD and already have a cardridge for a domain.
> >> Right now, the generator gets the model from an uml2 tool. The
> >> graphical editor I have to make (using GMF) for this domain should be
> >> able to read and write uml2 models because of reasons like flexibility
> >> (wheather or not to use my editor) or extended control of an uml tool
> >> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
> >> generator accept uml2 models from ecore.
> >>
> >> DSL:
> >> There various reasons why a tend to create my own domain specific
> >> language (DSL) for my graphical editor (GE) in contrast to use
> >> uml2.ecore:
> >> * a DSL which uses around 10 classes seems to be overburdened if it's
> >> based on the uml2.ecore with several hundred classes.
> >> * not that error prone because less confusion for the GMF framework
> >> and even more important for me.
> >> * some constraints are already implicit from my DSL Metamodel (MM) and
> >> the others should be easier to write on a simple MM.
> >> * It seems unhandy to create the uml2.ecore model code (after 5 hours
> >> I stopped the generation).
> >> * there must be a reason why GMF enforces the creation of DSLs rather
> >> than building a customized UML2 editor.
> >>
> >> The two worlds:
> >> This results in two worlds for my "MetaModel" sketch (see attached
> >> picture). In the left corner, we see famous UML with his well known
> >> metaclasses and packages. On the right corner we can see the young DSL
> >> also with metaclasses described in ecore. Now my experiments showed
> >> that the heavyweigth extensions in which I extended classes from the
> >> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
> >> and still be able to use standard uml tools is the lightweight
> >> approach. I sketched this with the outer circle around uml.
> >>
> >> Contraints:
> >> * I assume that I'm not restricting UML and
> >> * that every DSL Class has a pendant in uml with a lack of semantics
> >> expressable by stereotypes.
> >> * both MM are defined in EMF.
> >>
> >> The idea:
> >> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> >> creating a profile with sterotypes and enumerations for my DSL and
> >> represent my DSL classes in uml with the appropriate stereotype. I
> >> illustrated this in the 2nd picture "Concrete example" which shows
> >> instances of both MM. So on the right we can see the instance classes
> >> of MyDSL: a container, a class named Ex1 which is an instance of
> >> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> >> association between Ex1 and Ex2 and a class named Ex3 which is an
> >> instance of DSL-Class#2. Now I want to map them to UML. Following my
> >> example this would result in mapping:
> >> * an instance of container to an uml-package with sterotype
dsl-container
> >> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> >> sterotype dsl-class#1
> >> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> >> sterotype dsl-class#1
> >> * an association between Ex1 and Ex2 to an uml association (which may
> >> be stereotyped as "dsl-association if easier)
> >> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> >> sterotype dsl-class#2
> >>
> >> Other Mapping possibilities (mentioned if my vision doesn't work in
> >> time):
> >> * Model-to-Model transformation is an option. I rather dislike this
> >> for the classic reasons e.g. consistency between the models,
> >> overwriting or synchronization of changes and -for me the most
> >> important one- possible information loss due to the lack of
> >> representation in one language. In my example this means that if a
> >> "NotDslClass" exists in the left UML world for which I have no
> >> representation in MyDSL there is no need to represent it in MyDSL. But
> >> I guess I would be forced to handle it somehow not to loose
> >> information in the back-to-uml transformation.
> >> * Customized XML/XMI serialization through extending the XMLHelper
> >> also seems error prone and seems to require a good knowledge of
XMI,too.
> >>
> >> Ecore Mapping:
> >> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> >> editor but actually work directly on an UML model. I found the EMF
> >> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> >> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> >> found the some starting points or ideas how to realize it. My problem
> >> is I can hardly value them nor I know a kind of best practice for
> >> this. So it would be really nice to start a discussion about them or
> >> if you say just read this f****** manual because I'm stuck right now ;(
> >> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
> >> looks like an option but my impression is that this is not really what
> >> I want.
> >> * Abuse the Model classes (or facades), normally generated by generate
> >> model code as an adapter to eclipse-uml2 facades seems like a lot of
> >> work implying a pretty good understanding of EMF.
> >> * My Favourite: to use the Ecore2Ecore mapper and a customized
> >> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
> >> here is that it's just mentioned and not really described, but it
> >> seems exactly like what I want. This feeling is emphazied by features
> >> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> >> resources about that or if there isn't a simple proof-of-concept
> >> example somewhere.
> >>
> >> Thanks for reading already
> >> -stefan
> >>
> >>
>
>> ------------------------------------------------------------ ------------
> >>
> >

> For an example of the ecore2ecore mapping have a look at
> org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
This
> is a mapping between older and newer verion of UML and is used for
forward
> migration. The org.eclipse.uml2.uml.resource contains code behind the
> migration. ( you might want to have a look at the migration guide
from the
> UML wiki .. it explains the mapping in a human readable format ).
I stumbled over it some weeks ago but skipped it because I thought it
has nothing to do with my problem. So I'm definitly going to take a look
on it soon. Thanks for the hint.

> There are draft articles for creating DSL in bugzilla [77413], and links
> from the UML wiki.
> You might also want to have a look at the UMLTools project for creating
> editors for your own metamodel.
I already looked at both. I played around with Heavyweight-Extensions
but it seemed preety much that other UML Tools e.g. MagicDraw won't
handle heavyweight extensions at all. So customizing the UML editor of
UMLTools is not an option neither.

I found an error in my first post:
"Now my experiments showed that the heavyweigth extensions in which I
extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant.
So the only way to customize uml and still be able to use standard uml
tools is the lightweight approach."

thanks so far
-stefan

>
> Hope that helps,
>
> - James.
>
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jhq2$76t$1@build.eclipse.org...
>> Hi Ed,
>>
>> I expressed my hopes with "So it would be really nice to start a
>> discussion about them or if you say just read this f****** manual
>> because I'm stuck right now ;( " in a way that people can say I did it
>> this way or this way is really awful/awesome or this is the best way to
>> do it.
>>
>> and later on my 'question' in the last point "I'm wondering where I can
>> find good resources about that or if there isn't a simple
>> proof-of-concept example somewhere.".
>>
>> Anyway, the question-representation looks like this:
>> Does anybody know good resources which may help me realizing My
>> Favourite approach(the last) point under EcoreMapping?
>>
>> I can't imagine that this is a new problem/approach, so is there already
>> a proof-of-concept example somewhere?
>>
>> > I does sound like it would be
>> > perhaps a lot simpler to design your own independent model that has no
>> > relation to UML2
>> Of course ;). My problem is that I somehow need this representation in
>> UML (I described this in Use Case).
>>
>> greets
>> stefan
>>
>>
>>
>>
>>
>> Ed Merks schrieb:
>>> Stefan,
>>>
>>> It is indeed a long post and I actually can't find a single "?" in it,
>>> so I'm not really sure what to say. , but I don't think I really
> understood well all the
>>> issues and concerns...
>>>
>>>
>>> SKuhn wrote:
>>>> hi folks,
>>>>
>>>> the following text is quite long, so if you're in a rush just read
>>>> abstract, look at the picture, read constraints, the idea and the last
>>>> point of ecore-mapping.
>>>>
>>>> Abstract:
>>>> basically I want to be able to read & write proper UML2 models with my
>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>> going to outline it in detail because I didn't find a good way to
>>>> start / solve it.
>>>>
>>>> Use Case:
>>>> We're working with MDSD and already have a cardridge for a domain.
>>>> Right now, the generator gets the model from an uml2 tool. The
>>>> graphical editor I have to make (using GMF) for this domain should be
>>>> able to read and write uml2 models because of reasons like flexibility
>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>> generator accept uml2 models from ecore.
>>>>
>>>> DSL:
>>>> There various reasons why a tend to create my own domain specific
>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>> uml2.ecore:
>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>> based on the uml2.ecore with several hundred classes.
>>>> * not that error prone because less confusion for the GMF framework
>>>> and even more important for me.
>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>> the others should be easier to write on a simple MM.
>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>> I stopped the generation).
>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>> than building a customized UML2 editor.
>>>>
>>>> The two worlds:
>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>> picture). In the left corner, we see famous UML with his well known
>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>> also with metaclasses described in ecore. Now my experiments showed
>>>> that the heavyweigth extensions in which I extended classes from the
>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>> and still be able to use standard uml tools is the lightweight
>>>> approach. I sketched this with the outer circle around uml.
>>>>
>>>> Contraints:
>>>> * I assume that I'm not restricting UML and
>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>> expressable by stereotypes.
>>>> * both MM are defined in EMF.
>>>>
>>>> The idea:
>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>> instances of both MM. So on the right we can see the instance classes
>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>> example this would result in mapping:
>>>> * an instance of container to an uml-package with sterotype
> dsl-container
>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>> sterotype dsl-class#1
>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>> sterotype dsl-class#1
>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>> be stereotyped as "dsl-association if easier)
>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>> sterotype dsl-class#2
>>>>
>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>> time):
>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>> for the classic reasons e.g. consistency between the models,
>>>> overwriting or synchronization of changes and -for me the most
>>>> important one- possible information loss due to the lack of
>>>> representation in one language. In my example this means that if a
>>>> "NotDslClass" exists in the left UML world for which I have no
>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>> I guess I would be forced to handle it somehow not to loose
>>>> information in the back-to-uml transformation.
>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>> also seems error prone and seems to require a good knowledge of
> XMI,too.
>>>> Ecore Mapping:
>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>> editor but actually work directly on an UML model. I found the EMF
>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>> found the some starting points or ideas how to realize it. My problem
>>>> is I can hardly value them nor I know a kind of best practice for
>>>> this. So it would be really nice to start a discussion about them or
>>>> if you say just read this f****** manual because I'm stuck right now ;(
>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>> looks like an option but my impression is that this is not really what
>>>> I want.
>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>> work implying a pretty good understanding of EMF.
>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>> here is that it's just mentioned and not really described, but it
>>>> seems exactly like what I want. This feeling is emphazied by features
>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>> resources about that or if there isn't a simple proof-of-concept
>>>> example somewhere.
>>>>
>>>> Thanks for reading already
>>>> -stefan
>>>>
>>>>
>>> ------------------------------------------------------------ ------------
>
>

Two forces:
You must facilitate modeling of instances of your DSL in your Tool.
You must interoperate with UML tools.

Deal with them separately:

Do your custom DSL editor, i.e. with GMF
Convert to/from Eclipse UML2.1 with Model2Model transformations,
Save UML2 interoperable .xmi files from Eclipse UML2.1
(some tools will not interoperate with the default .xmi from Eclipse)
Keep asking, to figure out how to interoperate with Diagrams
from other tools.

Cheers,
Antonio

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jtnn$d33$1@build.eclipse.org...
> hi james,
>
> > For an example of the ecore2ecore mapping have a look at
> > org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
> This
> > is a mapping between older and newer verion of UML and is used for
> forward
> > migration. The org.eclipse.uml2.uml.resource contains code behind the
> > migration. ( you might want to have a look at the migration guide
> from the
> > UML wiki .. it explains the mapping in a human readable format ).
> I stumbled over it some weeks ago but skipped it because I thought it has
> nothing to do with my problem. So I'm definitly going to take a look on it
> soon. Thanks for the hint.
>
> > There are draft articles for creating DSL in bugzilla [77413], and links
> > from the UML wiki.
> > You might also want to have a look at the UMLTools project for creating
> > editors for your own metamodel.
> I already looked at both. I played around with Heavyweight-Extensions but
> it seemed preety much that other UML Tools e.g. MagicDraw won't handle
> heavyweight extensions at all. So customizing the UML editor of UMLTools
> is not an option neither.
>
> I found an error in my first post:
> "Now my experiments showed that the heavyweigth extensions in which I
> extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant. So
> the only way to customize uml and still be able to use standard uml tools
> is the lightweight approach."
>
> thanks so far
> -stefan
>
>
>
>>
>> Hope that helps,
>>
>> - James.
>>
>>
>> "SKuhn" <kuhn@oio.de> wrote in message
>> news:f4jhq2$76t$1@build.eclipse.org...
>>> Hi Ed,
>>>
>>> I expressed my hopes with "So it would be really nice to start a
>>> discussion about them or if you say just read this f****** manual
>>> because I'm stuck right now ;( " in a way that people can say I did it
>>> this way or this way is really awful/awesome or this is the best way to
>>> do it.
>>>
>>> and later on my 'question' in the last point "I'm wondering where I can
>>> find good resources about that or if there isn't a simple
>>> proof-of-concept example somewhere.".
>>>
>>> Anyway, the question-representation looks like this:
>>> Does anybody know good resources which may help me realizing My
>>> Favourite approach(the last) point under EcoreMapping?
>>>
>>> I can't imagine that this is a new problem/approach, so is there already
>>> a proof-of-concept example somewhere?
>>>
>>> > I does sound like it would be
>>> > perhaps a lot simpler to design your own independent model that has
>>> no
>>> > relation to UML2
>>> Of course ;). My problem is that I somehow need this representation in
>>> UML (I described this in Use Case).
>>>
>>> greets
>>> stefan
>>>
>>>
>>>
>>>
>>>
>>> Ed Merks schrieb:
>>>> Stefan,
>>>>
>>>> It is indeed a long post and I actually can't find a single "?" in it,
>>>> so I'm not really sure what to say. , but I don't think I really
>> understood well all the
>>>> issues and concerns...
>>>>
>>>>
>>>> SKuhn wrote:
>>>>> hi folks,
>>>>>
>>>>> the following text is quite long, so if you're in a rush just read
>>>>> abstract, look at the picture, read constraints, the idea and the last
>>>>> point of ecore-mapping.
>>>>>
>>>>> Abstract:
>>>>> basically I want to be able to read & write proper UML2 models with my
>>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>>> going to outline it in detail because I didn't find a good way to
>>>>> start / solve it.
>>>>>
>>>>> Use Case:
>>>>> We're working with MDSD and already have a cardridge for a domain.
>>>>> Right now, the generator gets the model from an uml2 tool. The
>>>>> graphical editor I have to make (using GMF) for this domain should be
>>>>> able to read and write uml2 models because of reasons like flexibility
>>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>>> generator accept uml2 models from ecore.
>>>>>
>>>>> DSL:
>>>>> There various reasons why a tend to create my own domain specific
>>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>>> uml2.ecore:
>>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>>> based on the uml2.ecore with several hundred classes.
>>>>> * not that error prone because less confusion for the GMF framework
>>>>> and even more important for me.
>>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>>> the others should be easier to write on a simple MM.
>>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>>> I stopped the generation).
>>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>>> than building a customized UML2 editor.
>>>>>
>>>>> The two worlds:
>>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>>> picture). In the left corner, we see famous UML with his well known
>>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>>> also with metaclasses described in ecore. Now my experiments showed
>>>>> that the heavyweigth extensions in which I extended classes from the
>>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>>> and still be able to use standard uml tools is the lightweight
>>>>> approach. I sketched this with the outer circle around uml.
>>>>>
>>>>> Contraints:
>>>>> * I assume that I'm not restricting UML and
>>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>>> expressable by stereotypes.
>>>>> * both MM are defined in EMF.
>>>>>
>>>>> The idea:
>>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>>> instances of both MM. So on the right we can see the instance classes
>>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>>> example this would result in mapping:
>>>>> * an instance of container to an uml-package with sterotype
>> dsl-container
>>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>>> sterotype dsl-class#1
>>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>>> sterotype dsl-class#1
>>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>>> be stereotyped as "dsl-association if easier)
>>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>>> sterotype dsl-class#2
>>>>>
>>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>>> time):
>>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>>> for the classic reasons e.g. consistency between the models,
>>>>> overwriting or synchronization of changes and -for me the most
>>>>> important one- possible information loss due to the lack of
>>>>> representation in one language. In my example this means that if a
>>>>> "NotDslClass" exists in the left UML world for which I have no
>>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>>> I guess I would be forced to handle it somehow not to loose
>>>>> information in the back-to-uml transformation.
>>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>>> also seems error prone and seems to require a good knowledge of
>> XMI,too.
>>>>> Ecore Mapping:
>>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>>> editor but actually work directly on an UML model. I found the EMF
>>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>>> found the some starting points or ideas how to realize it. My problem
>>>>> is I can hardly value them nor I know a kind of best practice for
>>>>> this. So it would be really nice to start a discussion about them or
>>>>> if you say just read this f****** manual because I'm stuck right now
>>>>> ;(
>>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>>> looks like an option but my impression is that this is not really what
>>>>> I want.
>>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>>> work implying a pretty good understanding of EMF.
>>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>>> here is that it's just mentioned and not really described, but it
>>>>> seems exactly like what I want. This feeling is emphazied by features
>>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>>> resources about that or if there isn't a simple proof-of-concept
>>>>> example somewhere.
>>>>>
>>>>> Thanks for reading already
>>>>> -stefan
>>>>>
>>>>>
>>>> ------------------------------------------------------------ ------------
>>

SKuhn schrieb:
> hi folks,
>
> the following text is quite long, so if you're in a rush just read
> abstract, look at the picture, read constraints, the idea and the last
> point of ecore-mapping.
>
> Abstract:
> basically I want to be able to read & write proper UML2 models with my
> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
> going to outline it in detail because I didn't find a good way to start
> / solve it.
>
> Use Case:
> We're working with MDSD and already have a cardridge for a domain. Right
> now, the generator gets the model from an uml2 tool. The graphical
> editor I have to make (using GMF) for this domain should be able to read
> and write uml2 models because of reasons like flexibility (wheather or
> not to use my editor) or extended control of an uml tool (e.g to model
> the DTOs in the same file). Both, UML2 Tools and the generator accept
> uml2 models from ecore.
>
> DSL:
> There various reasons why a tend to create my own domain specific
> language (DSL) for my graphical editor (GE) in contrast to use uml2.ecore:
> * a DSL which uses around 10 classes seems to be overburdened if it's
> based on the uml2.ecore with several hundred classes.
> * not that error prone because less confusion for the GMF framework and
> even more important for me.
> * some constraints are already implicit from my DSL Metamodel (MM) and
> the others should be easier to write on a simple MM.
> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
> stopped the generation).
> * there must be a reason why GMF enforces the creation of DSLs rather
> than building a customized UML2 editor.
>
> The two worlds:
> This results in two worlds for my "MetaModel" sketch (see attached
> picture). In the left corner, we see famous UML with his well known
> metaclasses and packages. On the right corner we can see the young DSL
> also with metaclasses described in ecore. Now my experiments showed that
> the heavyweigth extensions in which I extended classes from the
> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
> still be able to use standard uml tools is the lightweight approach. I
> sketched this with the outer circle around uml.
>
> Contraints:
> * I assume that I'm not restricting UML and
> * that every DSL Class has a pendant in uml with a lack of semantics
> expressable by stereotypes.
> * both MM are defined in EMF.
>
> The idea:
> is to connect my DSL-MM with the uml2-MM. This should be realizable by
> creating a profile with sterotypes and enumerations for my DSL and
> represent my DSL classes in uml with the appropriate stereotype. I
> illustrated this in the 2nd picture "Concrete example" which shows
> instances of both MM. So on the right we can see the instance classes of
> MyDSL: a container, a class named Ex1 which is an instance of
> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
> association between Ex1 and Ex2 and a class named Ex3 which is an
> instance of DSL-Class#2. Now I want to map them to UML. Following my
> example this would result in mapping:
> * an instance of container to an uml-package with sterotype dsl-container
> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
> sterotype dsl-class#1
> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
> sterotype dsl-class#1
> * an association between Ex1 and Ex2 to an uml association (which may be
> stereotyped as "dsl-association if easier)
> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
> sterotype dsl-class#2
>
> Other Mapping possibilities (mentioned if my vision doesn't work in time):
> * Model-to-Model transformation is an option. I rather dislike this for
> the classic reasons e.g. consistency between the models, overwriting or
> synchronization of changes and -for me the most important one- possible
> information loss due to the lack of representation in one language. In
> my example this means that if a "NotDslClass" exists in the left UML
> world for which I have no representation in MyDSL there is no need to
> represent it in MyDSL. But I guess I would be forced to handle it
> somehow not to loose information in the back-to-uml transformation.
> * Customized XML/XMI serialization through extending the XMLHelper also
> seems error prone and seems to require a good knowledge of XMI,too.
>
> Ecore Mapping:
> So a better approach would be to simulate the DSL-MM for my GMF-DSL
> editor but actually work directly on an UML model. I found the EMF part
> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
> found the some starting points or ideas how to realize it. My problem is
> I can hardly value them nor I know a kind of best practice for this. So
> it would be really nice to start a discussion about them or if you say
> just read this f****** manual because I'm stuck right now ;(
> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
> like an option but my impression is that this is not really what I want.
> * Abuse the Model classes (or facades), normally generated by generate
> model code as an adapter to eclipse-uml2 facades seems like a lot of
> work implying a pretty good understanding of EMF.
> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
> it's just mentioned and not really described, but it seems exactly like
> what I want. This feeling is emphazied by features like
> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
> resources about that or if there isn't a simple proof-of-concept example
> somewhere.
>
> Thanks for reading already
> -stefan
>
>
> ------------------------------------------------------------ ------------
>

Marco Mosconi schrieb:
> Hi,
>
> I didn't read through the whole post, but if you just want to bridge
> your DSL with UML2 Profiles, perhaps the following is exactly what you
> want:
> http://www.eclipse.org/gmt/amw/usecases/umlprofiles/
>
> Regards,
> Marco
>
> SKuhn schrieb:
>> hi folks,
>>
>> the following text is quite long, so if you're in a rush just read
>> abstract, look at the picture, read constraints, the idea and the last
>> point of ecore-mapping.
>>
>> Abstract:
>> basically I want to be able to read & write proper UML2 models with my
>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>> going to outline it in detail because I didn't find a good way to
>> start / solve it.
>>
>> Use Case:
>> We're working with MDSD and already have a cardridge for a domain.
>> Right now, the generator gets the model from an uml2 tool. The
>> graphical editor I have to make (using GMF) for this domain should be
>> able to read and write uml2 models because of reasons like flexibility
>> (wheather or not to use my editor) or extended control of an uml tool
>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>> generator accept uml2 models from ecore.
>>
>> DSL:
>> There various reasons why a tend to create my own domain specific
>> language (DSL) for my graphical editor (GE) in contrast to use
>> uml2.ecore:
>> * a DSL which uses around 10 classes seems to be overburdened if it's
>> based on the uml2.ecore with several hundred classes.
>> * not that error prone because less confusion for the GMF framework
>> and even more important for me.
>> * some constraints are already implicit from my DSL Metamodel (MM) and
>> the others should be easier to write on a simple MM.
>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>> I stopped the generation).
>> * there must be a reason why GMF enforces the creation of DSLs rather
>> than building a customized UML2 editor.
>>
>> The two worlds:
>> This results in two worlds for my "MetaModel" sketch (see attached
>> picture). In the left corner, we see famous UML with his well known
>> metaclasses and packages. On the right corner we can see the young DSL
>> also with metaclasses described in ecore. Now my experiments showed
>> that the heavyweigth extensions in which I extended classes from the
>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>> and still be able to use standard uml tools is the lightweight
>> approach. I sketched this with the outer circle around uml.
>>
>> Contraints:
>> * I assume that I'm not restricting UML and
>> * that every DSL Class has a pendant in uml with a lack of semantics
>> expressable by stereotypes.
>> * both MM are defined in EMF.
>>
>> The idea:
>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>> creating a profile with sterotypes and enumerations for my DSL and
>> represent my DSL classes in uml with the appropriate stereotype. I
>> illustrated this in the 2nd picture "Concrete example" which shows
>> instances of both MM. So on the right we can see the instance classes
>> of MyDSL: a container, a class named Ex1 which is an instance of
>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>> association between Ex1 and Ex2 and a class named Ex3 which is an
>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>> example this would result in mapping:
>> * an instance of container to an uml-package with sterotype dsl-container
>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>> sterotype dsl-class#1
>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>> sterotype dsl-class#1
>> * an association between Ex1 and Ex2 to an uml association (which may
>> be stereotyped as "dsl-association if easier)
>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>> sterotype dsl-class#2
>>
>> Other Mapping possibilities (mentioned if my vision doesn't work in
>> time):
>> * Model-to-Model transformation is an option. I rather dislike this
>> for the classic reasons e.g. consistency between the models,
>> overwriting or synchronization of changes and -for me the most
>> important one- possible information loss due to the lack of
>> representation in one language. In my example this means that if a
>> "NotDslClass" exists in the left UML world for which I have no
>> representation in MyDSL there is no need to represent it in MyDSL. But
>> I guess I would be forced to handle it somehow not to loose
>> information in the back-to-uml transformation.
>> * Customized XML/XMI serialization through extending the XMLHelper
>> also seems error prone and seems to require a good knowledge of XMI,too.
>>
>> Ecore Mapping:
>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>> editor but actually work directly on an UML model. I found the EMF
>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>> found the some starting points or ideas how to realize it. My problem
>> is I can hardly value them nor I know a kind of best practice for
>> this. So it would be really nice to start a discussion about them or
>> if you say just read this f****** manual because I'm stuck right now ;(
>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>> looks like an option but my impression is that this is not really what
>> I want.
>> * Abuse the Model classes (or facades), normally generated by generate
>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>> work implying a pretty good understanding of EMF.
>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>> here is that it's just mentioned and not really described, but it
>> seems exactly like what I want. This feeling is emphazied by features
>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>> resources about that or if there isn't a simple proof-of-concept
>> example somewhere.
>>
>> Thanks for reading already
>> -stefan
>>
>>
>> ------------------------------------------------------------ ------------
>>

> You must facilitate modeling of instances of your DSL in your Tool.
> You must interoperate with UML tools.
right.

I've got some concerns about M2M Transformation:
* Possible data loss, because my target model (MyDSL) doensn't represent
all the elements I have in my source model (e.g. UML+Profile). (main
concern)
* It looks like my problem already is adressed with ecore2ecore (using
the OPTION_RECORD_UNKNOWN_FEATURE) with pre/post-processing the data
with an recource handler.
* M2M implies addional overhead, serverals RecourceSets and I guess no
chance for event based handling (this would result in sync 'models', so
I can use eclipse with MyGui4MyDSL and the eclipse UML2 modelling tools
at the same time) (this point is -of course- just nice to have).

cheers
stefan

Antonio Carrasco schrieb:
> My 2 cents:
>
> Two forces:
> You must facilitate modeling of instances of your DSL in your Tool.
> You must interoperate with UML tools.
>
> Deal with them separately:
>
> Do your custom DSL editor, i.e. with GMF
> Convert to/from Eclipse UML2.1 with Model2Model transformations,
> Save UML2 interoperable .xmi files from Eclipse UML2.1
> (some tools will not interoperate with the default .xmi from Eclipse)
> Keep asking, to figure out how to interoperate with Diagrams
> from other tools.
>
> Cheers,
> Antonio
>
>
>
>
>
>
>
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jtnn$d33$1@build.eclipse.org...
>> hi james,
>>
>>> For an example of the ecore2ecore mapping have a look at
>>> org.eclipse.uml2.uml \model at UML2_2_UML.ecore2ecore and .ecore2xml.
>> This
>>> is a mapping between older and newer verion of UML and is used for
>> forward
>>> migration. The org.eclipse.uml2.uml.resource contains code behind the
>>> migration. ( you might want to have a look at the migration guide
>> from the
>>> UML wiki .. it explains the mapping in a human readable format ).
>> I stumbled over it some weeks ago but skipped it because I thought it has
>> nothing to do with my problem. So I'm definitly going to take a look on it
>> soon. Thanks for the hint.
>>
>>> There are draft articles for creating DSL in bugzilla [77413], and links
>>> from the UML wiki.
>>> You might also want to have a look at the UMLTools project for creating
>>> editors for your own metamodel.
>> I already looked at both. I played around with Heavyweight-Extensions but
>> it seemed preety much that other UML Tools e.g. MagicDraw won't handle
>> heavyweight extensions at all. So customizing the UML editor of UMLTools
>> is not an option neither.
>>
>> I found an error in my first post:
>> "Now my experiments showed that the heavyweigth extensions in which I
>> extended classes from the uml2.ecore are !!!NOT!!! uml2-xmi compliant. So
>> the only way to customize uml and still be able to use standard uml tools
>> is the lightweight approach."
>>
>> thanks so far
>> -stefan
>>
>>
>>
>>> Hope that helps,
>>>
>>> - James.
>>>
>>>
>>> "SKuhn" <kuhn@oio.de> wrote in message
>>> news:f4jhq2$76t$1@build.eclipse.org...
>>>> Hi Ed,
>>>>
>>>> I expressed my hopes with "So it would be really nice to start a
>>>> discussion about them or if you say just read this f****** manual
>>>> because I'm stuck right now ;( " in a way that people can say I did it
>>>> this way or this way is really awful/awesome or this is the best way to
>>>> do it.
>>>>
>>>> and later on my 'question' in the last point "I'm wondering where I can
>>>> find good resources about that or if there isn't a simple
>>>> proof-of-concept example somewhere.".
>>>>
>>>> Anyway, the question-representation looks like this:
>>>> Does anybody know good resources which may help me realizing My
>>>> Favourite approach(the last) point under EcoreMapping?
>>>>
>>>> I can't imagine that this is a new problem/approach, so is there already
>>>> a proof-of-concept example somewhere?
>>>>
>>>> > I does sound like it would be
>>>> > perhaps a lot simpler to design your own independent model that has
>>>> no
>>>> > relation to UML2
>>>> Of course ;). My problem is that I somehow need this representation in
>>>> UML (I described this in Use Case).
>>>>
>>>> greets
>>>> stefan
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Ed Merks schrieb:
>>>>> Stefan,
>>>>>
>>>>> It is indeed a long post and I actually can't find a single "?" in it,
>>>>> so I'm not really sure what to say. , but I don't think I really
>>> understood well all the
>>>>> issues and concerns...
>>>>>
>>>>>
>>>>> SKuhn wrote:
>>>>>> hi folks,
>>>>>>
>>>>>> the following text is quite long, so if you're in a rush just read
>>>>>> abstract, look at the picture, read constraints, the idea and the last
>>>>>> point of ecore-mapping.
>>>>>>
>>>>>> Abstract:
>>>>>> basically I want to be able to read & write proper UML2 models with my
>>>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>>>> going to outline it in detail because I didn't find a good way to
>>>>>> start / solve it.
>>>>>>
>>>>>> Use Case:
>>>>>> We're working with MDSD and already have a cardridge for a domain.
>>>>>> Right now, the generator gets the model from an uml2 tool. The
>>>>>> graphical editor I have to make (using GMF) for this domain should be
>>>>>> able to read and write uml2 models because of reasons like flexibility
>>>>>> (wheather or not to use my editor) or extended control of an uml tool
>>>>>> (e.g to model the DTOs in the same file). Both, UML2 Tools and the
>>>>>> generator accept uml2 models from ecore.
>>>>>>
>>>>>> DSL:
>>>>>> There various reasons why a tend to create my own domain specific
>>>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>>>> uml2.ecore:
>>>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>>>> based on the uml2.ecore with several hundred classes.
>>>>>> * not that error prone because less confusion for the GMF framework
>>>>>> and even more important for me.
>>>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>>>> the others should be easier to write on a simple MM.
>>>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours
>>>>>> I stopped the generation).
>>>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>>>> than building a customized UML2 editor.
>>>>>>
>>>>>> The two worlds:
>>>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>>>> picture). In the left corner, we see famous UML with his well known
>>>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>>>> also with metaclasses described in ecore. Now my experiments showed
>>>>>> that the heavyweigth extensions in which I extended classes from the
>>>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml
>>>>>> and still be able to use standard uml tools is the lightweight
>>>>>> approach. I sketched this with the outer circle around uml.
>>>>>>
>>>>>> Contraints:
>>>>>> * I assume that I'm not restricting UML and
>>>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>>>> expressable by stereotypes.
>>>>>> * both MM are defined in EMF.
>>>>>>
>>>>>> The idea:
>>>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>>>> instances of both MM. So on the right we can see the instance classes
>>>>>> of MyDSL: a container, a class named Ex1 which is an instance of
>>>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>>>> example this would result in mapping:
>>>>>> * an instance of container to an uml-package with sterotype
>>> dsl-container
>>>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>>>> sterotype dsl-class#1
>>>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>>>> sterotype dsl-class#1
>>>>>> * an association between Ex1 and Ex2 to an uml association (which may
>>>>>> be stereotyped as "dsl-association if easier)
>>>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>>>> sterotype dsl-class#2
>>>>>>
>>>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>>>> time):
>>>>>> * Model-to-Model transformation is an option. I rather dislike this
>>>>>> for the classic reasons e.g. consistency between the models,
>>>>>> overwriting or synchronization of changes and -for me the most
>>>>>> important one- possible information loss due to the lack of
>>>>>> representation in one language. In my example this means that if a
>>>>>> "NotDslClass" exists in the left UML world for which I have no
>>>>>> representation in MyDSL there is no need to represent it in MyDSL. But
>>>>>> I guess I would be forced to handle it somehow not to loose
>>>>>> information in the back-to-uml transformation.
>>>>>> * Customized XML/XMI serialization through extending the XMLHelper
>>>>>> also seems error prone and seems to require a good knowledge of
>>> XMI,too.
>>>>>> Ecore Mapping:
>>>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>>>> editor but actually work directly on an UML model. I found the EMF
>>>>>> part of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>>>> found the some starting points or ideas how to realize it. My problem
>>>>>> is I can hardly value them nor I know a kind of best practice for
>>>>>> this. So it would be really nice to start a discussion about them or
>>>>>> if you say just read this f****** manual because I'm stuck right now
>>>>>> ;(
>>>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff)
>>>>>> looks like an option but my impression is that this is not really what
>>>>>> I want.
>>>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>>>> work implying a pretty good understanding of EMF.
>>>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized
>>>>>> rescource handler as mentioned in EMF-EclipseCon p.158ff. My issue
>>>>>> here is that it's just mentioned and not really described, but it
>>>>>> seems exactly like what I want. This feeling is emphazied by features
>>>>>> like OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>>>> resources about that or if there isn't a simple proof-of-concept
>>>>>> example somewhere.
>>>>>>
>>>>>> Thanks for reading already
>>>>>> -stefan
>>>>>>
>>>>>>
>>>>> ------------------------------------------------------------ ------------
>

Several of the approaches you describe seem valid. A major difference (an
perhaps a deciding factor) between them seems (to me) to be whether
synchronization between the two domains (your DSL and UML, which
incidentally can also be viewed as a DSL) happens dynamically (at the
in-memory object representation level) or only when a resource is
serialized/deserialized.

The Ecore2Ecore model was designed as a mechanism to describe simple
mappings between two arbitrary EMF (Ecore) models. Ecore2XML was introduced
to provide an alternative representation of suuch mappings that is tailored
to (de)serialization in XML/XMI. In practice, Ecore2XML is really only
useful for mapping between two models that are similar in structure - as
James has mentioned, it is being used successfully in UML2 to migrate models
between different versions of UML. Note that complex mappings still need to
be handled using custom resource handlers and/or post processors (as
described in the advanced EMF tutorials from EclipseCon 2006 and 2007).
Beyond the EMF tutorials, perhaps the best source of information is the
source code. James has already provided you with pointers to the releated
classes in UML2... has this been of some help?

Kenn

"SKuhn" <kuhn@oio.de> wrote in message
news:f4jhq2$76t$1@build.eclipse.org...
> Hi Ed,
>
> I expressed my hopes with "So it would be really nice to start a
> discussion about them or if you say just read this f****** manual because
> I'm stuck right now ;( " in a way that people can say I did it this way
> or this way is really awful/awesome or this is the best way to do it.
>
> and later on my 'question' in the last point "I'm wondering where I can
> find good resources about that or if there isn't a simple proof-of-concept
> example somewhere.".
>
> Anyway, the question-representation looks like this:
> Does anybody know good resources which may help me realizing My Favourite
> approach(the last) point under EcoreMapping?
>
> I can't imagine that this is a new problem/approach, so is there already a
> proof-of-concept example somewhere?
>
> > I does sound like it would be
> > perhaps a lot simpler to design your own independent model that has no
> > relation to UML2
> Of course ;). My problem is that I somehow need this representation in UML
> (I described this in Use Case).
>
> greets
> stefan
>
>
>
>
>
> Ed Merks schrieb:
>> Stefan,
>>
>> It is indeed a long post and I actually can't find a single "?" in it, so
>> I'm not really sure what to say. , but I don't think I really understood
>> well all the issues and concerns...
>>
>>
>> SKuhn wrote:
>>> hi folks,
>>>
>>> the following text is quite long, so if you're in a rush just read
>>> abstract, look at the picture, read constraints, the idea and the last
>>> point of ecore-mapping.
>>>
>>> Abstract:
>>> basically I want to be able to read & write proper UML2 models with my
>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>> going to outline it in detail because I didn't find a good way to start
>>> / solve it.
>>>
>>> Use Case:
>>> We're working with MDSD and already have a cardridge for a domain. Right
>>> now, the generator gets the model from an uml2 tool. The graphical
>>> editor I have to make (using GMF) for this domain should be able to read
>>> and write uml2 models because of reasons like flexibility (wheather or
>>> not to use my editor) or extended control of an uml tool (e.g to model
>>> the DTOs in the same file). Both, UML2 Tools and the generator accept
>>> uml2 models from ecore.
>>>
>>> DSL:
>>> There various reasons why a tend to create my own domain specific
>>> language (DSL) for my graphical editor (GE) in contrast to use
>>> uml2.ecore:
>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>> based on the uml2.ecore with several hundred classes.
>>> * not that error prone because less confusion for the GMF framework and
>>> even more important for me.
>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>> the others should be easier to write on a simple MM.
>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
>>> stopped the generation).
>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>> than building a customized UML2 editor.
>>>
>>> The two worlds:
>>> This results in two worlds for my "MetaModel" sketch (see attached
>>> picture). In the left corner, we see famous UML with his well known
>>> metaclasses and packages. On the right corner we can see the young DSL
>>> also with metaclasses described in ecore. Now my experiments showed that
>>> the heavyweigth extensions in which I extended classes from the
>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
>>> still be able to use standard uml tools is the lightweight approach. I
>>> sketched this with the outer circle around uml.
>>>
>>> Contraints:
>>> * I assume that I'm not restricting UML and
>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>> expressable by stereotypes.
>>> * both MM are defined in EMF.
>>>
>>> The idea:
>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>> creating a profile with sterotypes and enumerations for my DSL and
>>> represent my DSL classes in uml with the appropriate stereotype. I
>>> illustrated this in the 2nd picture "Concrete example" which shows
>>> instances of both MM. So on the right we can see the instance classes of
>>> MyDSL: a container, a class named Ex1 which is an instance of
>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>> example this would result in mapping:
>>> * an instance of container to an uml-package with sterotype
>>> dsl-container
>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>> sterotype dsl-class#1
>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>> sterotype dsl-class#1
>>> * an association between Ex1 and Ex2 to an uml association (which may be
>>> stereotyped as "dsl-association if easier)
>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>> sterotype dsl-class#2
>>>
>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>> time):
>>> * Model-to-Model transformation is an option. I rather dislike this for
>>> the classic reasons e.g. consistency between the models, overwriting or
>>> synchronization of changes and -for me the most important one- possible
>>> information loss due to the lack of representation in one language. In
>>> my example this means that if a "NotDslClass" exists in the left UML
>>> world for which I have no representation in MyDSL there is no need to
>>> represent it in MyDSL. But I guess I would be forced to handle it
>>> somehow not to loose information in the back-to-uml transformation.
>>> * Customized XML/XMI serialization through extending the XMLHelper also
>>> seems error prone and seems to require a good knowledge of XMI,too.
>>>
>>> Ecore Mapping:
>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>> editor but actually work directly on an UML model. I found the EMF part
>>> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>> found the some starting points or ideas how to realize it. My problem is
>>> I can hardly value them nor I know a kind of best practice for this. So
>>> it would be really nice to start a discussion about them or if you say
>>> just read this f****** manual because I'm stuck right now ;(
>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
>>> like an option but my impression is that this is not really what I want.
>>> * Abuse the Model classes (or facades), normally generated by generate
>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>> work implying a pretty good understanding of EMF.
>>> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
>>> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
>>> it's just mentioned and not really described, but it seems exactly like
>>> what I want. This feeling is emphazied by features like
>>> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>> resources about that or if there isn't a simple proof-of-concept example
>>> somewhere.
>>>
>>> Thanks for reading already
>>> -stefan
>>>
>>>
>>> ------------------------------------------------------------ ------------
>>>
>>

Honestly I have the feeling that there is no really good solution. I
ended up with the decicion to implement a DSL->UML2 M2M transformation
with xTend (oAW, because GMF already uses xPand and they're similar).
I'm running out of time, so I have no space left for experiments ;(.
Thanks for your reply anyway.

Kenn Hussey schrieb:
> Stefan,
>
> Several of the approaches you describe seem valid. A major difference (an
> perhaps a deciding factor) between them seems (to me) to be whether
> synchronization between the two domains (your DSL and UML, which
> incidentally can also be viewed as a DSL) happens dynamically (at the
> in-memory object representation level) or only when a resource is
> serialized/deserialized.
>
> The Ecore2Ecore model was designed as a mechanism to describe simple
> mappings between two arbitrary EMF (Ecore) models. Ecore2XML was introduced
> to provide an alternative representation of suuch mappings that is tailored
> to (de)serialization in XML/XMI. In practice, Ecore2XML is really only
> useful for mapping between two models that are similar in structure - as
> James has mentioned, it is being used successfully in UML2 to migrate models
> between different versions of UML. Note that complex mappings still need to
> be handled using custom resource handlers and/or post processors (as
> described in the advanced EMF tutorials from EclipseCon 2006 and 2007).
> Beyond the EMF tutorials, perhaps the best source of information is the
> source code. James has already provided you with pointers to the releated
> classes in UML2... has this been of some help?
>
> Kenn
>
> "SKuhn" <kuhn@oio.de> wrote in message
> news:f4jhq2$76t$1@build.eclipse.org...
>> Hi Ed,
>>
>> I expressed my hopes with "So it would be really nice to start a
>> discussion about them or if you say just read this f****** manual because
>> I'm stuck right now ;( " in a way that people can say I did it this way
>> or this way is really awful/awesome or this is the best way to do it.
>>
>> and later on my 'question' in the last point "I'm wondering where I can
>> find good resources about that or if there isn't a simple proof-of-concept
>> example somewhere.".
>>
>> Anyway, the question-representation looks like this:
>> Does anybody know good resources which may help me realizing My Favourite
>> approach(the last) point under EcoreMapping?
>>
>> I can't imagine that this is a new problem/approach, so is there already a
>> proof-of-concept example somewhere?
>>
>>> I does sound like it would be
>>> perhaps a lot simpler to design your own independent model that has no
>>> relation to UML2
>> Of course ;). My problem is that I somehow need this representation in UML
>> (I described this in Use Case).
>>
>> greets
>> stefan
>>
>>
>>
>>
>>
>> Ed Merks schrieb:
>>> Stefan,
>>>
>>> It is indeed a long post and I actually can't find a single "?" in it, so
>>> I'm not really sure what to say. , but I don't think I really understood
>>> well all the issues and concerns...
>>>
>>>
>>> SKuhn wrote:
>>>> hi folks,
>>>>
>>>> the following text is quite long, so if you're in a rush just read
>>>> abstract, look at the picture, read constraints, the idea and the last
>>>> point of ecore-mapping.
>>>>
>>>> Abstract:
>>>> basically I want to be able to read & write proper UML2 models with my
>>>> GMF-DSL Editor. For me this sounds like a real common problem, but I'm
>>>> going to outline it in detail because I didn't find a good way to start
>>>> / solve it.
>>>>
>>>> Use Case:
>>>> We're working with MDSD and already have a cardridge for a domain. Right
>>>> now, the generator gets the model from an uml2 tool. The graphical
>>>> editor I have to make (using GMF) for this domain should be able to read
>>>> and write uml2 models because of reasons like flexibility (wheather or
>>>> not to use my editor) or extended control of an uml tool (e.g to model
>>>> the DTOs in the same file). Both, UML2 Tools and the generator accept
>>>> uml2 models from ecore.
>>>>
>>>> DSL:
>>>> There various reasons why a tend to create my own domain specific
>>>> language (DSL) for my graphical editor (GE) in contrast to use
>>>> uml2.ecore:
>>>> * a DSL which uses around 10 classes seems to be overburdened if it's
>>>> based on the uml2.ecore with several hundred classes.
>>>> * not that error prone because less confusion for the GMF framework and
>>>> even more important for me.
>>>> * some constraints are already implicit from my DSL Metamodel (MM) and
>>>> the others should be easier to write on a simple MM.
>>>> * It seems unhandy to create the uml2.ecore model code (after 5 hours I
>>>> stopped the generation).
>>>> * there must be a reason why GMF enforces the creation of DSLs rather
>>>> than building a customized UML2 editor.
>>>>
>>>> The two worlds:
>>>> This results in two worlds for my "MetaModel" sketch (see attached
>>>> picture). In the left corner, we see famous UML with his well known
>>>> metaclasses and packages. On the right corner we can see the young DSL
>>>> also with metaclasses described in ecore. Now my experiments showed that
>>>> the heavyweigth extensions in which I extended classes from the
>>>> uml2.ecore are uml2-xmi compliant. So the only way to customize uml and
>>>> still be able to use standard uml tools is the lightweight approach. I
>>>> sketched this with the outer circle around uml.
>>>>
>>>> Contraints:
>>>> * I assume that I'm not restricting UML and
>>>> * that every DSL Class has a pendant in uml with a lack of semantics
>>>> expressable by stereotypes.
>>>> * both MM are defined in EMF.
>>>>
>>>> The idea:
>>>> is to connect my DSL-MM with the uml2-MM. This should be realizable by
>>>> creating a profile with sterotypes and enumerations for my DSL and
>>>> represent my DSL classes in uml with the appropriate stereotype. I
>>>> illustrated this in the 2nd picture "Concrete example" which shows
>>>> instances of both MM. So on the right we can see the instance classes of
>>>> MyDSL: a container, a class named Ex1 which is an instance of
>>>> DSL-Class#1, a class named Ex2 which is an instance of DSL-Class#1 an
>>>> association between Ex1 and Ex2 and a class named Ex3 which is an
>>>> instance of DSL-Class#2. Now I want to map them to UML. Following my
>>>> example this would result in mapping:
>>>> * an instance of container to an uml-package with sterotype
>>>> dsl-container
>>>> * an instance of DSL-Class#1 named Ex1 to an uml-class named Ex1 with
>>>> sterotype dsl-class#1
>>>> * an instance of DSL-Class#1 named Ex2 to an uml-class named Ex2 with
>>>> sterotype dsl-class#1
>>>> * an association between Ex1 and Ex2 to an uml association (which may be
>>>> stereotyped as "dsl-association if easier)
>>>> * an instance of DSL-Class#2 named Ex3 to an uml-class named Ex3 with
>>>> sterotype dsl-class#2
>>>>
>>>> Other Mapping possibilities (mentioned if my vision doesn't work in
>>>> time):
>>>> * Model-to-Model transformation is an option. I rather dislike this for
>>>> the classic reasons e.g. consistency between the models, overwriting or
>>>> synchronization of changes and -for me the most important one- possible
>>>> information loss due to the lack of representation in one language. In
>>>> my example this means that if a "NotDslClass" exists in the left UML
>>>> world for which I have no representation in MyDSL there is no need to
>>>> represent it in MyDSL. But I guess I would be forced to handle it
>>>> somehow not to loose information in the back-to-uml transformation.
>>>> * Customized XML/XMI serialization through extending the XMLHelper also
>>>> seems error prone and seems to require a good knowledge of XMI,too.
>>>>
>>>> Ecore Mapping:
>>>> So a better approach would be to simulate the DSL-MM for my GMF-DSL
>>>> editor but actually work directly on an UML model. I found the EMF part
>>>> of IBMs EMF/GEF book and the "Effective Use of Eclipse Modeling
>>>> Framework" from EclipseCon 2007 (EMF-EclipseCon) quite interesting and
>>>> found the some starting points or ideas how to realize it. My problem is
>>>> I can hardly value them nor I know a kind of best practice for this. So
>>>> it would be really nice to start a discussion about them or if you say
>>>> just read this f****** manual because I'm stuck right now ;(
>>>> * refering the UML-MM in MyDSL (as described in IBMs book p. 36ff) looks
>>>> like an option but my impression is that this is not really what I want.
>>>> * Abuse the Model classes (or facades), normally generated by generate
>>>> model code as an adapter to eclipse-uml2 facades seems like a lot of
>>>> work implying a pretty good understanding of EMF.
>>>> * My Favourite: to use the Ecore2Ecore mapper and a customized rescource
>>>> handler as mentioned in EMF-EclipseCon p.158ff. My issue here is that
>>>> it's just mentioned and not really described, but it seems exactly like
>>>> what I want. This feeling is emphazied by features like
>>>> OPTION_RECORD_UNKOWN_FEATURE. I'm wondering where I can find good
>>>> resources about that or if there isn't a simple proof-of-concept example
>>>> somewhere.
>>>>
>>>> Thanks for reading already
>>>> -stefan
>>>>
>>>>
>>>> ------------------------------------------------------------ ------------
>>>>
>
>