Skip to main content



      Home
Home » Modeling » MoDisco » [Announce] M2T templates for Java metamodel
[Announce] M2T templates for Java metamodel [message #507111] Tue, 12 January 2010 03:45 Go to next message
Eclipse UserFriend
Hello,

A new plugin, for working with Java models, is available :

the goal of this 'Java Generation' plugin is to allow Java code
generation from a Java model.
Such a generation will participate to Legacy Refactoring & Migration chains.

For more informations :
http://wiki.eclipse.org/MoDisco/JavaGeneration

--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #507134 is a reply to message #507111] Tue, 12 January 2010 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Just a quick question, are those templates generated or hand-coded ?
Re: [Announce] M2T templates for Java metamodel [message #507166 is a reply to message #507134] Tue, 12 January 2010 06:11 Go to previous messageGo to next message
Eclipse UserFriend
Le 12/01/2010 10:47, Sylvain EVEILLARD a écrit :
> Just a quick question, are those templates generated or hand-coded ?

templates are 95% hand-coded (templates declarations were generated)


--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #509870 is a reply to message #507111] Mon, 25 January 2010 11:13 Go to previous messageGo to next message
Eclipse UserFriend
I have a question about it :
Can I suppose it to work for a basic "round-trip" scenario.
I mean can I use the injector from Java code to Model and then use the M2T templates from Model to Java code without loosing information? (e.g., retrieving the original Java source code).

Interesting work indeed.
Re: [Announce] M2T templates for Java metamodel [message #509893 is a reply to message #507111] Mon, 25 January 2010 11:48 Go to previous messageGo to next message
Eclipse UserFriend
I, myself, needed à 100% round-trip so I used the JDT Rewrite API.
I used two switches in order to go from a JavaAST model to a JavaAST DOM and then used JDT APIs to write the corresponding code.
Re: [Announce] M2T templates for Java metamodel [message #509943 is a reply to message #509870] Mon, 25 January 2010 15:31 Go to previous message
Eclipse UserFriend
Hi Jean-Sebastien, hi Sylvain,

"Java discoverer +M2T" process allows quite a round-trip scenario :

- you will not loose any Java information (including ordering)
- you will loose your original indentation (spaces, tabs, line feed) -> in fact, at the end of the M2T, a call to JDT formater is done (i.e. ctrl+shift+f)
- some '/***...*' will become '/*'
- some '{' may appear enclosing blocks which did not have it before (e.g. within if statements).

Moreover, at the moment, there is an issue on discoverer which may move some Java comments, i will fix it asap.


In order to improve the round-trip, i suppose we may follow two ways :
- build traceability links with original files parts, to restore original source regions where not modified.
- as Sylvain suggests it, keep links to JDT AST nodes to use JDT rewriting apis.
Re: [Announce] M2T templates for Java metamodel [message #574167 is a reply to message #507111] Tue, 12 January 2010 04:47 Go to previous message
Eclipse UserFriend
Just a quick question, are those templates generated or hand-coded ?
Re: [Announce] M2T templates for Java metamodel [message #574175 is a reply to message #507134] Tue, 12 January 2010 06:11 Go to previous message
Eclipse UserFriend
Le 12/01/2010 10:47, Sylvain EVEILLARD a écrit :
> Just a quick question, are those templates generated or hand-coded ?

templates are 95% hand-coded (templates declarations were generated)


--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #574416 is a reply to message #507111] Mon, 25 January 2010 11:13 Go to previous message
Eclipse UserFriend
I have a question about it :
Can I suppose it to work for a basic "round-trip" scenario.
I mean can I use the injector from Java code to Model and then use the M2T templates from Model to Java code without loosing information? (e.g., retrieving the original Java source code).

Interesting work indeed.
Re: [Announce] M2T templates for Java metamodel [message #574439 is a reply to message #507111] Mon, 25 January 2010 11:48 Go to previous message
Eclipse UserFriend
I, myself, needed à 100% round-trip so I used the JDT Rewrite API.
I used two switches in order to go from a JavaAST model to a JavaAST DOM and then used JDT APIs to write the corresponding code.
Re: [Announce] M2T templates for Java metamodel [message #574467 is a reply to message #574416] Mon, 25 January 2010 15:31 Go to previous message
Eclipse UserFriend
Hi Jean-Sebastien, hi Sylvain,

"Java discoverer +M2T" process allows quite a round-trip scenario :

- you will not loose any Java information (including ordering)
- you will loose your original indentation (spaces, tabs, line feed) -> in fact, at the end of the M2T, a call to JDT formater is done (i.e. ctrl+shift+f)
- some '/***...*' will become '/*'
- some '{' may appear enclosing blocks which did not have it before (e.g. within if statements).

Moreover, at the moment, there is an issue on discoverer which may move some Java comments, i will fix it asap.


In order to improve the round-trip, i suppose we may follow two ways :
- build traceability links with original files parts, to restore original source regions where not modified.
- as Sylvain suggests it, keep links to JDT AST nodes to use JDT rewriting apis.

--
----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Château de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Previous Topic:"Role" renamed to "Facet"
Next Topic:Two MoDisco talks accepted at next EclipseCon 2010, March 22nd - 25th, in Santa Clara (California)!
Goto Forum:
  


Current Time: Tue Jul 22 19:18:01 EDT 2025

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

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

Back to the top