Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » JET and EMF XML Persistence
JET and EMF XML Persistence [message #51790] |
Fri, 22 September 2006 03:48  |
Eclipse User |
|
|
|
Hi ,
I have a fundemental ambiguity about JET2 ( or JET) and EMF persistence
as XML .
Scenario:
I have an EMF model e.g an Struts Modeler , i need the model to give
artifacts like the following
1.struts-config.xml
2. Java classes
I have an confusion on whether to use JET or EMF XMI persistence ,
ofcourse for generating Java files we need to have JET, how about XML?
If we use JET for xml generation , then how can we make it synchronous
with model changes i.e when ever i change the model those corresponding
changes needs to be reflected in the JET2 Transformations with holding any
previous changes that the user has made to the transformer file . E.g
Plugin.xml editor
Ultimate query is when to go for EMF XML persistence and JET or how to use
both in conjunction.
Pointers ( if any) to the same will be highly helpful
Thanks,
Kamesh
|
|
|
Re: JET and EMF XML Persistence [message #51982 is a reply to message #51790] |
Fri, 22 September 2006 09:01  |
Eclipse User |
|
|
|
Kamesh:
To summarize your problem, you are generating an artifact that is both
textual and has a well defined meta-model. The question: Do you use a JET
Template and generate text, or do you build up the model using its EMF
generated Java API.
My answer: It depends.
Template based solutions like JET work best when the proportion of variable
text to invariant text is relatively low. So, if you are generating a
struts-config.xml file, and you are replacing only a small part of it, I'd
say using JET is a good choice.
On the other hand, if every element in the struts-config.xml file is
variable, and dependent on your model, then JET is not as good a fit. Your
generation would require knowledge at about the API level, and JET templates
would have very little invariant text in them. You may still want to
consider a template-based approach if what you generate is not 100%
prescribed, and, as a result, some of your end users may want to generate it
differently. It is relatively easy to build your JET transformation so that
end users can override individual templates and make such changes.
Paul Elder
JET Lead.
"Kamesh Sampath" <kamesh_sampath@msn.com> wrote in message
news:d624a31a7a3fe85a0ea9e2197fcfa450$1@www.eclipse.org...
> Hi ,
> I have a fundemental ambiguity about JET2 ( or JET) and EMF persistence
> as XML .
> Scenario:
>
> I have an EMF model e.g an Struts Modeler , i need the model to give
> artifacts like the following
>
> 1.struts-config.xml 2. Java classes
>
> I have an confusion on whether to use JET or EMF XMI persistence ,
> ofcourse for generating Java files we need to have JET, how about XML?
>
> If we use JET for xml generation , then how can we make it synchronous
> with model changes i.e when ever i change the model those corresponding
> changes needs to be reflected in the JET2 Transformations with holding any
> previous changes that the user has made to the transformer file . E.g
> Plugin.xml editor
> Ultimate query is when to go for EMF XML persistence and JET or how to use
> both in conjunction.
>
> Pointers ( if any) to the same will be highly helpful
>
> Thanks,
> Kamesh
>
|
|
|
Re: JET and EMF XML Persistence [message #591741 is a reply to message #51790] |
Fri, 22 September 2006 09:01  |
Eclipse User |
|
|
|
Kamesh:
To summarize your problem, you are generating an artifact that is both
textual and has a well defined meta-model. The question: Do you use a JET
Template and generate text, or do you build up the model using its EMF
generated Java API.
My answer: It depends.
Template based solutions like JET work best when the proportion of variable
text to invariant text is relatively low. So, if you are generating a
struts-config.xml file, and you are replacing only a small part of it, I'd
say using JET is a good choice.
On the other hand, if every element in the struts-config.xml file is
variable, and dependent on your model, then JET is not as good a fit. Your
generation would require knowledge at about the API level, and JET templates
would have very little invariant text in them. You may still want to
consider a template-based approach if what you generate is not 100%
prescribed, and, as a result, some of your end users may want to generate it
differently. It is relatively easy to build your JET transformation so that
end users can override individual templates and make such changes.
Paul Elder
JET Lead.
"Kamesh Sampath" <kamesh_sampath@msn.com> wrote in message
news:d624a31a7a3fe85a0ea9e2197fcfa450$1@www.eclipse.org...
> Hi ,
> I have a fundemental ambiguity about JET2 ( or JET) and EMF persistence
> as XML .
> Scenario:
>
> I have an EMF model e.g an Struts Modeler , i need the model to give
> artifacts like the following
>
> 1.struts-config.xml 2. Java classes
>
> I have an confusion on whether to use JET or EMF XMI persistence ,
> ofcourse for generating Java files we need to have JET, how about XML?
>
> If we use JET for xml generation , then how can we make it synchronous
> with model changes i.e when ever i change the model those corresponding
> changes needs to be reflected in the JET2 Transformations with holding any
> previous changes that the user has made to the transformer file . E.g
> Plugin.xml editor
> Ultimate query is when to go for EMF XML persistence and JET or how to use
> both in conjunction.
>
> Pointers ( if any) to the same will be highly helpful
>
> Thanks,
> Kamesh
>
|
|
|
Goto Forum:
Current Time: Sat May 03 03:58:50 EDT 2025
Powered by FUDForum. Page generated in 0.02898 seconds
|