Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » [Announce] M2T templates for Java metamodel
[Announce] M2T templates for Java metamodel [message #507111] Tue, 12 January 2010 08:45 Go to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
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
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #507134 is a reply to message #507111] Tue, 12 January 2010 09:47 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
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 11:11 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
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
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #509870 is a reply to message #507111] Mon, 25 January 2010 16:13 Go to previous messageGo to next message
Jean-Sebastien Sottet is currently offline Jean-Sebastien SottetFriend
Messages: 4
Registered: July 2009
Junior Member
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 16:48 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
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 20:31 Go to previous message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
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
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #574167 is a reply to message #507111] Tue, 12 January 2010 09:47 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
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 11:11 Go to previous message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
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
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
Re: [Announce] M2T templates for Java metamodel [message #574416 is a reply to message #507111] Mon, 25 January 2010 16:13 Go to previous message
Jean-Sebastien Sottet is currently offline Jean-Sebastien SottetFriend
Messages: 4
Registered: July 2009
Junior Member
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 16:48 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
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 20:31 Go to previous message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 147
Registered: July 2009
Senior Member
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
----------------------------------------------------


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
rue Nina Simone
44000 NANTES
----------------------------------------------------
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: Fri Mar 29 05:54:00 GMT 2024

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

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

Back to the top