Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » User of infant JET
User of infant JET [message #24636] Fri, 29 June 2007 15:25 Go to next message
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
Hi,
I have been using JET for a year and a half. I am using the Merlin stuff.
I write fairly standard templates in a Project with a Jet nature and use
the JETBuilder to transform into Java. I then invoke these at runtime
passing in my "genmodel". Basically I'm still doing stuff as outlined in
Remkos articles...
http://dev.eclipse.org/viewcvs/indextools.cgi/org.eclipse.em f/doc/org.eclipse.emf.doc/tutorials/jet1/jet_tutorial1.html
The Merlin stuff is very useful because of its editor.

I could really do with custom tag libraries as some of my templates
require some kind of recursion to function properly. However I have a lot
of complex templates. How easy will it be to move to a version of Jet with
custom tag libraries? Chris Aniszcyk & Nathan Marz article
http://www-128.ibm.com/developerworks/java/library/os-ecl-je t/index.html?ca=drs
seems to concentrate on XML transformation, but most of my stuff is
fairly dynamic translation at runtime of EMF Objects. I assume I can still
function in the old compiled template + EObject argument way?

Thanks, the project looks very useful.
Re: User of infant JET [message #25085 is a reply to message #24636] Wed, 04 July 2007 17:09 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
JF:

"JET2", in addition to adding support for custom tags, has a number of
additional features. Some of the most significant ones:

* JET1 templates write to a StringBuffer, whilst JET2 templates write to a
JET2Writer
* JET1 templates receive a single argument of type Object, whilst JET2
templates receive a JET2Context, which defines a 'source' model, as well as
any number of 'variables'
* JET1 templates return you a String; what you do with it is your business.
The assumed JET1 usage model is that you will write a Java program/plug-in
around your templates to do something useful with their results.
* On the other hand, JET2 includes tags that will both run a template and
write results to the Eclipse workspace. The assumed JET2 usage model is that
you will create a JET2 'transformation' in which templates are executed and
results written without the need to write any Java code.

I don't avocate migration just for migration's sake - any migration you
undertake should provide you with some tangible benefit. Here are some of my
initial thoughts:

1) Adopt the M2T JET builder, which is capable of compiling your templates
into the same Java code as before. With this, you will be able to take
advantage of some of the services that JET2 provides, and enable the
following steps.

2) Migrate the orchestration code (the code that runs templates and writes
their results) from Java to the JET tags. JET2 is capable of invoking JET1
templates with a little bit of fiddling.

3) Migrate individual templates to JET2 and tag libraries.

I haven't included a lot of detail above, partly because I need to work
through an example and get all the details right. I will start creating some
FAQ articles, and add additional responses to this post as I do.

Paul



"JF" <jfrancis@his.co.uk> wrote in message
news:75694a725188bde51cbd2eae07730648$1@www.eclipse.org...
> Hi,
> I have been using JET for a year and a half. I am using the Merlin stuff.
> I write fairly standard templates in a Project with a Jet nature and use
> the JETBuilder to transform into Java. I then invoke these at runtime
> passing in my "genmodel". Basically I'm still doing stuff as outlined in
> Remkos articles...
> http://dev.eclipse.org/viewcvs/indextools.cgi/org.eclipse.em f/doc/org.eclipse.emf.doc/tutorials/jet1/jet_tutorial1.html
> The Merlin stuff is very useful because of its editor.
>
> I could really do with custom tag libraries as some of my templates
> require some kind of recursion to function properly. However I have a lot
> of complex templates. How easy will it be to move to a version of Jet with
> custom tag libraries? Chris Aniszcyk & Nathan Marz article
> http://www-128.ibm.com/developerworks/java/library/os-ecl-je t/index.html?ca=drs
> seems to concentrate on XML transformation, but most of my stuff is fairly
> dynamic translation at runtime of EMF Objects. I assume I can still
> function in the old compiled template + EObject argument way?
>
> Thanks, the project looks very useful.
>
>
>
Previous Topic:[JET2] - Is there a way to check if a variable has been defined
Next Topic:Content assist/Locating error in JETEditor
Goto Forum:
  


Current Time: Fri Apr 26 10:52:10 GMT 2024

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

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

Back to the top