I am new to Model to Text transformation and JET. All i know that JET helps in generating code in java, SQL, XML etc using templates. My confusion is If you have to generate code then the metamodel has to be of hte code nature. Means if you have to generate java code you can only do it through java metamodel and not any other metamodel???
If you're just starting with M2T, you might want to research a bit
harder about what M2T language you use.
JET is very well-established but predates modeling.
Acceleo is meta-model driven with OCL expressions complying with the OMG
Xpand is meta-model driven with enhanced Java expressions
On 22/06/2012 12:41, noi poi wrote:
> hey hi there
> I am new to Model to Text transformation and JET. All i know that JET
> helps in generating code in java, SQL, XML etc using templates. My
> confusion is If you have to generate code then the metamodel has to be
> of hte code nature. Means if you have to generate java code you can
> only do it through java metamodel and not any other metamodel???
M2T uses your (or a library template) to generate text, which just might
happen to be Java or SQL source code. Whether the text actually conforms
to a language specification is entirely down to the diligence of the
M2M uses your (or a library transformation) to generate 'a' model, which
inherently complies with 'the' target meta-model. If you want inherently
accurate Java then you need to look for a M2M transformation to the Java
On 23/06/2012 09:43, noi poi wrote:
> Thank you Edward for your reply but you see i wanted to know that
> using any M2T language you can only generate specific code using that
> specific metamodel.
> Java code can only be generated if models are specified in Java
If you're a model purist. Yes. M2M then trivial M2T.
However for a simple transformation, direct to Java saves a step and has
very rapid debugging feedback so it is more 'fun'.
On 26/06/2012 09:50, noi poi wrote:
> Thank you Edward for the explaination. So for the correct code
> generation, you should follow
> 1. Source metamodel to Java metamodel transformation
> 2. Java metamodel to Text code generation.