Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » simple JET2 example?
simple JET2 example? [message #41566] Thu, 07 February 2008 16:36 Go to next message
Eclipse User
Originally posted by: gregwilson5.yahoo.com

We're comparing JET2 vs. FreeMarker for our code generation. We initially
compared FreeMarker against JET, and decided that FreeMarker was more
suitable, but then realized we were comparing against JET1. We've read
some about JET2, but haven't found a simple example to get us bootstrapped.

In our case, we have a few XSDs from which we've created Ecore models and
generated the corresponding model classes. We want to use instantiations
of the model classes as the input/model for our code generation.

I can see JET2's integration with JMerge as an advantage over FreeMarker,
given that we need to support protecting manually-added code in some
generated classes. Any others advantages to JET2?

Thanks,
Greg
Re: simple JET2 example? [message #41788 is a reply to message #41566] Wed, 13 February 2008 16:00 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Greg:

I won't offer any opinions on FreeMarker - I don't have any experience with
it...

Some of the strenghts of JET2:

* Eclipse integration. JET2 transformations are Eclipse workspace aware. If
you are writing content to the workspace (via tags like ws:file, java:class,
....), then you automatically get:
* participation in team environment protocols. (Some team environments
require explicit checkout before modification - the Team environment
provides for this).
* no need to write Java code to save results.

* Extensible language. Because JET2 is based on the tag library concept, it
is possible to extend the language control structures, etc....

* Extensible model navigation. Like FreeMarker, JET has an extensible
mechanism for model traversal. The language JET uses is XPath, but more than
just XML documents may be traversed. For example, out-of-the-box, JET can
traverse XML documents, and EMF-based model and the Eclipse workspace. I
have created prototypes to traverse other models including JDT ASTs, Java5/6
annotation models, ....

Paul

"Greg Wilson" <gregwilson5@yahoo.com> wrote in message
news:97ebefe31b51a5453fc143b0afcb1f87$1@www.eclipse.org...
> We're comparing JET2 vs. FreeMarker for our code generation. We initially
> compared FreeMarker against JET, and decided that FreeMarker was more
> suitable, but then realized we were comparing against JET1. We've read
> some about JET2, but haven't found a simple example to get us
> bootstrapped.
>
> In our case, we have a few XSDs from which we've created Ecore models and
> generated the corresponding model classes. We want to use instantiations
> of the model classes as the input/model for our code generation.
>
> I can see JET2's integration with JMerge as an advantage over FreeMarker,
> given that we need to support protecting manually-added code in some
> generated classes. Any others advantages to JET2?
>
> Thanks,
> Greg
>
Re: simple JET2 example? [message #41946 is a reply to message #41788] Fri, 15 February 2008 14:19 Go to previous messageGo to next message
Eclipse User
Originally posted by: ymo.noemail.com

Hi.

jet pros
1) nice editor
2) generation based on metadata and typed object
3) genration is contained in compiled java objects. This is huge if you
want to distribute your code generation as binaries and don't want your
competitors to see your code generation tekniks.

cons:
1) dependency in eclipse. This is my only grip with jet. I am trying to
ship my code generation as a canned and headless rcp application. The
problem is that jet was done with the assumption that the input file is
part of a project to be accessible. I have not found a way i can tell jet
to load a file without a reference to an existing project. Maybe Paul can
correct me here.
Also when you are generating files you cant generate them in file system.

freemarker pros:
1) can be shiped standalone
2)generation is simple files. So your template users can modify them.
freemarker cons:
1) no editors
2) cant use ${} in your template. (or i have not figured)
3) cant generate a file from within a template.
Re: simple JET2 example? [message #42103 is a reply to message #41946] Fri, 22 February 2008 13:01 Go to previous messageGo to next message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
With respect to:

> cons:
> 1) dependency in eclipse. This is my only grip with jet. I am trying to
> ship my code generation as a canned and headless rcp application. The
> problem is that jet was done with the assumption that the input file is
> part of a project to be accessible. I have not found a way i can tell jet
> to load a file without a reference to an existing project. Maybe Paul can
> correct me here.
> Also when you are generating files you cant generate them in file system.

Paul

"ymo" <ymo@noemail.com> wrote in message
news:d72bf183c3ba20e03e0ecbb5b904e6dd$1@www.eclipse.org...
> Hi.
>
> jet pros
> 1) nice editor
> 2) generation based on metadata and typed object
> 3) genration is contained in compiled java objects. This is huge if you
> want to distribute your code generation as binaries and don't want your
> competitors to see your code generation tekniks.
>
> cons:
> 1) dependency in eclipse. This is my only grip with jet. I am trying to
> ship my code generation as a canned and headless rcp application. The
> problem is that jet was done with the assumption that the input file is
> part of a project to be accessible. I have not found a way i can tell jet
> to load a file without a reference to an existing project. Maybe Paul can
> correct me here.
> Also when you are generating files you cant generate them in file system.
>
> freemarker pros:
> 1) can be shiped standalone
> 2)generation is simple files. So your template users can modify them.
> freemarker cons:
> 1) no editors
> 2) cant use ${} in your template. (or i have not figured)
> 3) cant generate a file from within a template.
>
>
>
Re: simple JET2 example? [message #42197 is a reply to message #42103] Mon, 25 February 2008 18:49 Go to previous messageGo to next message
Eclipse User
Originally posted by: ymo.noemail.com

Hi Paul.

I did not what you mean ?
Re: simple JET2 example? [message #42216 is a reply to message #42197] Mon, 25 February 2008 21:37 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
It seems I forgot the meat of my reply. :-)

I am working on refactoring JET so that it runs in RCP and perhaps even less
'capable' environments. As part of that, I will be looking at creating tags
equivalent to ws:file and ws:folder that are independent of the Eclipse
workspace.

Paul

"ymo" <ymo@noemail.com> wrote in message
news:fc0defd819c8a9dd4e4eeeed64cd76fb$1@www.eclipse.org...
> Hi Paul.
>
> I did not what you mean ?
>
Previous Topic:Re: Obtaing Value
Next Topic:JET Exceptions and Exception Handling
Goto Forum:
  


Current Time: Sun Sep 21 20:09:28 GMT 2014

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

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