Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Suppress rather than override static JET templates
Suppress rather than override static JET templates [message #78290] Wed, 04 April 2007 09:01 Go to next message
Eclipse UserFriend
Originally posted by: claude.knaus.profidatalab.com

Hi,

I would like to use dynamic templates to generate some classes from a model.
In my case, I don't need all the classes which are generated by the static
templates.

Is there a way to suppress the processing of some of the static templates,
or do I need to use Merlin for this kind of flexibility?

-- Claude
Re: Suppress rather than override static JET templates [message #78368 is a reply to message #78290] Wed, 04 April 2007 13:28 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Claude:

I'm replying to the M2T newsgroup, as this is where JET/JET2 is moving.

It is not clear from your question whether you are using JET1 (that is, EMF
JET, org.eclipse.emf.codegen) or JET2 (org.eclipse.jet).

If you are using JET1, then you must negotiate with the creator of the Java
program that orchestrates the template invocations to create some sort of
semantic that indicates you don't want to generate a particular file.

If you are using JET2, you have a bit more control, as the template
invocations are also coded in JET templates that you can override (and thus
remove the invocation of the template you care about).

But the bottom line is that easy overriding of a transformation's behavior
(including suppression of some of its outputs) is the result of a design
decision in the original implementation. An analogy to Java classes is
appropriate: Just because the Java language lets you extend many classes, it
does not mean that many classes are easy to extend - the ones are are were
designed to be extended in particular ways.

So, if you're trying to extend an existing generator, it is worth talking
with the generator's author to see if they can adjust the design to support
you use case.

Paul

"Claude Knaus" <claude.knaus@profidatalab.com> wrote in message
news:euvpi7$uvf$1@build.eclipse.org...
> Hi,
>
> I would like to use dynamic templates to generate some classes from a
> model. In my case, I don't need all the classes which are generated by the
> static templates.
>
> Is there a way to suppress the processing of some of the static templates,
> or do I need to use Merlin for this kind of flexibility?
>
> -- Claude
>
Re: Suppress rather than override static JET templates [message #604337 is a reply to message #78290] Wed, 04 April 2007 13:28 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Claude:

I'm replying to the M2T newsgroup, as this is where JET/JET2 is moving.

It is not clear from your question whether you are using JET1 (that is, EMF
JET, org.eclipse.emf.codegen) or JET2 (org.eclipse.jet).

If you are using JET1, then you must negotiate with the creator of the Java
program that orchestrates the template invocations to create some sort of
semantic that indicates you don't want to generate a particular file.

If you are using JET2, you have a bit more control, as the template
invocations are also coded in JET templates that you can override (and thus
remove the invocation of the template you care about).

But the bottom line is that easy overriding of a transformation's behavior
(including suppression of some of its outputs) is the result of a design
decision in the original implementation. An analogy to Java classes is
appropriate: Just because the Java language lets you extend many classes, it
does not mean that many classes are easy to extend - the ones are are were
designed to be extended in particular ways.

So, if you're trying to extend an existing generator, it is worth talking
with the generator's author to see if they can adjust the design to support
you use case.

Paul

"Claude Knaus" <claude.knaus@profidatalab.com> wrote in message
news:euvpi7$uvf$1@build.eclipse.org...
> Hi,
>
> I would like to use dynamic templates to generate some classes from a
> model. In my case, I don't need all the classes which are generated by the
> static templates.
>
> Is there a way to suppress the processing of some of the static templates,
> or do I need to use Merlin for this kind of flexibility?
>
> -- Claude
>
Previous Topic:[Teneo] Teneo searches for mapping file(s) even it has been already loaded
Next Topic:fetching non-containment relations eagerly
Goto Forum:
  


Current Time: Wed Oct 21 14:35:49 GMT 2020

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

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

Back to the top