Suppress rather than override static JET templates [message #78290] |
Wed, 04 April 2007 05:01  |
Eclipse User |
|
|
|
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 09:28  |
Eclipse User |
|
|
|
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 09:28  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03422 seconds