Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 16:37 Go to next message
Kevin is currently offline KevinFriend
Messages: 1
Registered: March 2011
Location: Belgium
Junior Member
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 :

http://img541.imageshack.us/img541/2394/emf25.png
(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 16:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30541
Registered: July 2009
Senior Member
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 17:00 Go to previous message
Mariot Chauvin is currently offline Mariot ChauvinFriend
Messages: 174
Registered: July 2009
Senior Member
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/
Previous Topic:Extend an core Ecore model
Next Topic:[Teneo] Problem mapping an EMF relationship in Teneo
Goto Forum:
  


Current Time: Mon Oct 14 18:44:14 GMT 2019

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

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

Back to the top