Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Incremental mode
Incremental mode [message #1018732] Thu, 14 March 2013 11:28 Go to next message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
Hi,

i'm wondering how the incremental mode in MoDisco is implemented. Does "incremental" mean that if i run MoDisco on an already discovered project (e.g. if the source code was changed after the former discovery), that the resulting MoDisco model is updated rather than created from scratch again?

Regards,
Thomas
Re: Incremental mode [message #1018870 is a reply to message #1018732] Thu, 14 March 2013 15:44 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 612
Registered: July 2009
Senior Member
Hello,

MoDisco does not currently provide an incrementality support per se, as reverse engineering usually deals with legacy systems that are not modified anymore (or at least not frequently or significantly).

Talking about model discovery, the discoverers as provided by MoDisco currently allow to get models out of your projects but these models are not actually synchronized with the source code: if a modification occurs in the source code, the full corresponding model will have to be (re)generated.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Incremental mode [message #1018875 is a reply to message #1018870] Thu, 14 March 2013 15:56 Go to previous messageGo to next message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
Hi Hugo,

thanks a lot for your quick response. So in case i need the behavior described in the first post, i would need to modify the corresponding Java discoverers, right?
Would it be enough to create another JavaDiscoverer, or does it require more complex modifications in the internal MoDisco structure (e.g. changing the JavaReader, etc.)?

Thanks in advance,
Thomas
Re: Incremental mode [message #1018890 is a reply to message #1018875] Thu, 14 March 2013 16:16 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo BruneliereFriend
Messages: 612
Registered: July 2009
Senior Member
The implementation of each discoverer is independent from the MoDisco infrastructure.
Discoverers are just plugged onto MoDisco via a common interface.
So I guess the more efficient way to proceed for you is to start from the current implementation of the MoDisco Java discoverer for instance, and to modifiy it to create a "new" discoverer that you will later on also plugged onto MoDisco via this same interface.

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Incremental mode [message #1043813 is a reply to message #1018890] Thu, 18 April 2013 06:47 Go to previous messageGo to next message
Thomas Buchmann is currently offline Thomas BuchmannFriend
Messages: 53
Registered: November 2010
Member
Hi Hugo,

i did as you suggested. However i came across an issue: I think i found an inconsistency within the implementation of JDTVisitor. For some visit methods (e.g. for TypeDeclarations or MethodDeclarations) the flag isINCREMENTALDISCOVERING is used to determine previously discovered elements and reuse them. For other visit methods like the one for FieldDeclarations the check is missing. As a result, on each run of my incremental discoverer, the same field declarations are added over and over again. So my question is: Is this a bug or a feature Smile
In case this is a feature, i need to subclass JavaReader and JDTVisitor to realize my custom behavior. In that case i would kindly request to change the visibility of certain member variables in JDTVisitor to protected to allow subclassing.

Thanks in advance,
Thomas
Re: Incremental mode [message #1044051 is a reply to message #1043813] Thu, 18 April 2013 12:41 Go to previous message
Fabien Giquel is currently offline Fabien GiquelFriend
Messages: 138
Registered: July 2009
Senior Member
Hi Thomas,

I had a look at the JDTVisitor. Its seems to me that the code is complete for what it was supposed to do :

- the visit(VariableDeclarationFragment) does the job to determine previously references and reuse the proxy (call setProxy(false)).
- the visit(FieldDeclaration) does not have to do it, since a FieldDeclaration is just a container for VariableDeclarationFragment. No other statement has reference to one "FieldDeclaration".

Now may be the problem is that you consider the existing parameter called "INCREMENTAL_MODE" as a way to manage the incremental update of one java model. Actually the INCREMENTAL_MODE just proposes some memory optimization, not an attempt of "incremental model update" as you want to do. The memory optimization works as follows :

- when the jdtvisitor encouters some reference to unknown java type/method/field, a "proxy" element is created
- if INCREMENTAL_MODE==false, the discoverer tries to substitute "proxies" with concrete elements at the final end of discovery
- if INCREMENTAL_MODE==true, the discoverer tries to substitute "proxies" with concrete elements at many steps (each java package, and each time a type/method/field declaration is visited)




You may ask through one bugzilla entry to set some fields from JdtVisitor/JavaReader "protected". When possible, one commiter will study the impacts of this modification.

hoping it will help you,
Fabien.


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Ch√Ęteau de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Previous Topic:how to transform .uml to .xmi in modisco
Next Topic:Integration of xText and Modisco
Goto Forum:
  


Current Time: Thu Nov 27 17:35:10 GMT 2014

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

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