Home » Modeling » EMF » How to integrate a new metamodel in EMF ?(At the same level as UML, XSD...)
How to integrate a new metamodel in EMF ? [message #662442] |
Wed, 30 March 2011 12:37  |
Eclipse User |
|
|
|
Hi,
For my final year thesis as a business engineer in IT, I have to integrate MERODE, a modeling methodology based on a unique enterprise model with several views, in EMF.
Therefor, I first generated with EMF a MERODE tree editor plugin for Eclipse out of a MERODE metamodel that I wrote in Ecore. I customized the editor for de purposes of the MERODE method with consistency checks, automatic generation of model elements and so on. I have thus now an eclipse plugin that is able to produce enterprise models in .merode .
My goal now is to generate code from a .merode model within the EMF framework. I thus think, correct me if I'm wrong, that I have to integrate MERODE in EMF at the same level where UML, XSD etc by default are in EMF. And thus I have to do a mapping between MERODE and Ecore, so that I can generate a .ecore model from a .merode model. And from de .ecore model, than generate a .genmodel, code, etc.
I read a big part of the book "EMF, Eclipse Modeling Framework" 2nd Edition, they do mention this possibility. But I didn't saw how to concrete do it in there.
So to make it clear, my question is: how to concretely put MERODE at the place van "Other..." in the figure 2.5 (p23) of this book :

(The "Code model" being in Ecore)
In advance thank you for your answers,
Regards,
Kevin
|
|
|
Re: How to integrate a new metamodel in EMF ? [message #662447 is a reply to message #662442] |
Wed, 30 March 2011 12:54   |
Eclipse User |
|
|
|
Kevin,
Comments below.
Kevin wrote:
> Hi,
>
> For my final year thesis as a business engineer in IT, I have to
> integrate MERODE, a modeling methodology based on a unique enterprise
> model with several views, in EMF.
>
> Therefor, I first generated with EMF a MERODE tree editor plugin for
> Eclipse out of a MERODE metamodel that I wrote in Ecore. I customized
> the editor for de purposes of the MERODE method with consistency
> checks, automatic generation of model elements and so on. I have thus
> now an eclipse plugin that is able to produce enterprise models in
> .merode .
>
> My goal now is to generate code from a .merode model within the EMF
> framework. I thus think, correct me if I'm wrong, that I have to
> integrate MERODE in EMF at the same level where UML, XSD etc by
> default are in EMF.
Not necessarily...
> And thus I have to do a mapping between MERODE and Ecore, so that I
> can generate a .ecore model from a .merode model. And from de .ecore
> model, than generate a .genmodel, code, etc.
That's certainly a reasonable approach assuming that what's generated
for Ecore matches fairly closely what you'd like to achieve. There is
significant value in leveraging the full EMF runtime in what you
generated...
It's also reasonable to write your own templates in XPand, JET, or
Acceleo and generate you results directly from your own model.
>
> I read a big part of the book "EMF, Eclipse Modeling Framework" 2nd
> Edition, they do mention this possibility. But I didn't saw how to
> concrete do it in there.
>
> So to make it clear, my question is: how to concretely put MERODE at
> the place van "Other..." in the figure 2.5 (p23) of this book :
>
>
> (The "Code model" being in Ecore)
You'll need to explore the source code. Some things to look at would be
classes like XSDEcoreBuilder which maps XSD to Ecore, and
JavaEcoreBuilder which maps annotated Java to Ecore. You can look
closely at how these integrate with the rest of the importer framework.
You might eventually even want to look at the exporter aspect.
>
> In advance thank you for your answers,
> Regards,
> Kevin
|
|
|
Re: How to integrate a new metamodel in EMF ? [message #662448 is a reply to message #662442] |
Wed, 30 March 2011 13:00  |
Eclipse User |
|
|
|
Hi Kevin,
Comments below.
Le 30/03/2011 18:37, Kevin a écrit :
> Hi,
>
> For my final year thesis as a business engineer in IT, I have to
> integrate MERODE, a modeling methodology based on a unique enterprise
> model with several views, in EMF.
>
> Therefor, I first generated with EMF a MERODE tree editor plugin for
> Eclipse out of a MERODE metamodel that I wrote in Ecore. I customized
> the editor for de purposes of the MERODE method with consistency checks,
> automatic generation of model elements and so on. I have thus now an
> eclipse plugin that is able to produce enterprise models in .merode .
>
> My goal now is to generate code from a .merode model within the EMF
> framework. I thus think, correct me if I'm wrong, that I have to
> integrate MERODE in EMF at the same level where UML, XSD etc by default
You are wrong :).
You could easily generate code, with any EMF model such as MERODE mode,
with a M2T(Model-To-Text) generation tool, for instance Acceleo :
http://www.eclipse.org/acceleo/
If you have questions about acceleo do not hesitate to use the m2t
newsgroup/forum.
> are in EMF. And thus I have to do a mapping between MERODE and Ecore, so
> that I can generate a .ecore model from a .merode model. And from de
> .ecore model, than generate a .genmodel, code, etc.
When you create an .ecore file, you create a metamodel (for example
merode.ecore). With EMF you are able to generate the java code which
will be used for model instances (for example .merode files) and a tree
editor which enables to to create such model instances.
From the .merode files you will be able to generate code by using a M2T
tool.
>
> I read a big part of the book "EMF, Eclipse Modeling Framework" 2nd
> Edition, they do mention this possibility. But I didn't saw how to
> concrete do it in there.
>
> So to make it clear, my question is: how to concretely put MERODE at the
> place van "Other..." in the figure 2.5 (p23) of this book :
>
>
> (The "Code model" being in Ecore)
>
> In advance thank you for your answers,
> Regards,
> Kevin
--
Mariot Chauvin @ Obeo
Blog : http://mariot-thoughts.blogspot.com
Twitter :http://twitter.com/mchv
Professional support : http://obeo.fr/pages/maintenance-and-support/
|
|
|
Goto Forum:
Current Time: Wed Jul 23 11:02:08 EDT 2025
Powered by FUDForum. Page generated in 0.07146 seconds
|