2

my goal is to create a meta-model for a model but one level higher than by default with EMF. The meta-model(2) should define the possibilities and restrictions for the possible modles(1). Then I want to generate Java-code of this model.

2 meta-model 1 model 0 Java-code

So the model(1) is a kind of DSL and the meta-model is the definition of that DSL.

How can I do this. Is it possible with EMF or is there any other plugin from the Eclipse Modeling Project?

Im searching for some functionality like in this tool: http://www.actifsource.com/ but without specifying an extra generator template.

user1127860
  • 150
  • 2
  • 14
  • Here I found my solution: [http://christiandietrich.wordpress.com/2011/07/29/xtend2-code-generators-with-non-xtext-models/](http://christiandietrich.wordpress.com/2011/07/29/xtend2-code-generators-with-non-xtext-models/) – user1127860 Aug 14 '12 at 13:35

2 Answers2

1

You can use Xtext (EMF-based) to define your (textual) DSL. XText will generate the metamodel and the model editor so you can define your own models rather quickly. From there, you could use Acceleo (a template-based model-to-text generator) to generate java code from them.

Jordi Cabot
  • 8,058
  • 2
  • 33
  • 39
  • That is Not exactly what I want I think. I want to design a metamodel graphicaly. Similar to the possibility with EMF with the Ecore Tools to design *.ecorediag files. The point is, that I want to create something like a *.ecorediag from an other *.ecorediag. So the first diag is something like a model based on the ecore-metamodel and the second is based on the first meta-model. And then I want to generate Java code from the second meta-model. (After this meta-model there could by a model instance with concrete values of the variables and so on, but I don't need that) – user1127860 Jul 27 '12 at 08:40
0

Not sure you need meta-model, but you may check EMF Facet which allows you to extend existing Ecore metamodels without having to modify them.