Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Reverse Engineering Plugin based on MoDisco(Create an own plugin using functionality provided by MoDisco)
Reverse Engineering Plugin based on MoDisco [message #655435] Sun, 20 February 2011 18:07 Go to next message
Rob is currently offline Rob
Messages: 17
Registered: February 2011
Junior Member
Hello

I am currently dealing with a migration project on framework based web applications and after lots of research I decided to try Modisco.

For an easy to use tool I'd like to create an own plugin which can be started via context menu on the source project. To discover models from the java source files and xml configuration files I wanted to use functionality provided by Modisco but create an own Discoverer to only retrieve certain Compilation Units and xml files from the source project and therefor create a smaller model.

Are there any simple ways to build an own plugin using functionality of Modisco? As I have time constraints there should be simple possibilities to realize this.

My steps would be to use the plugin to initialize the migration process, create models from the relevant source files and xml-config files then do some m2m transformations for PIM and target PSM and start code generation for the target framework.

Many thanks in advance.
Re: Reverse Engineering Plugin based on MoDisco [message #655466 is a reply to message #655435] Mon, 21 February 2011 05:01 Go to previous messageGo to next message
Hugo Bruneliere is currently offline Hugo Bruneliere
Messages: 601
Registered: July 2009
Senior Member
Hello George,

First, thanks for your interest in the project.
As you described it, your use case is a very good application for the MoDisco framework.

Of course, you can directly reuse the available Java and XML discoverers by combining them together in your solution (i.e. a plug-in). You can also integrate the refinement of the obtained models, according to your targeted needs, by using M2M transformations.

To have more details on the related MoDisco components, I invite you to take a look to the reference documentation of the latest version: http://wiki.eclipse.org/MoDisco/Components/v0.9
It explains how to use the discoverers you will need, and how to chain them with the also provided Discovery Workflow.

I hope this is going to help you starting more easily.
And don't hesitate if you have any other question.

Best regards,

Hugo


------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
Re: Reverse Engineering Plugin based on MoDisco [message #655469 is a reply to message #655435] Mon, 21 February 2011 05:04 Go to previous messageGo to next message
Fabien Giquel is currently offline Fabien Giquel
Messages: 138
Registered: July 2009
Senior Member
Hi Georges,
here are some complementary information to Hugo's answer.

you may declare your own discoverer (using one extension point + implementing one org.eclipse.gmt.modisco.infra.discoverymanager.Discoverer interface). One method "isApplicableTo()" indicates on which discovery can be done. So if it is implemented to answer 'true" when parameter is instance of "IProject" or "IJavaProject" then your discoverer will automatically appear in context menu on one workspace project.
More information about writing one new discoverer can be found here : http://wiki.eclipse.org/MoDisco/Components/DiscoverersManage r/Documentation/0.8 (3.6 Helios released components).

(Note : Discovery Framework is currently refactored for Indigo 3.7 release, which will simplify and extend the framework. Documentation is in progress here : http://wiki.eclipse.org/MoDisco/Components/DiscoverersManage r/Documentation/0.9)


One discoverer implementation may reuse other discoverer (Java discover, Generic XML discoverer, ...).
e.g. the org.eclipse.modisco.java.composition.discoverer.actions.Disc overKDMSourceAndJavaModel (from org.eclipse.modisco.java.composition.discoverer) invokes the Java discoverer to obtain one Java model, and then the kdm.source discoverer to obtain one kdm.source model. The two models are referenced into one third global model which will be the result of the discovery (an ecore mm is defined in org.eclipse.modisco.java.composition).
The Java and kdm.source discoverer classes are directly instantiated but it is also possible to use the "DiscoveryManager" which serves as a discoverer registry.

The java discoverer proposes some filters (regular expression) which allows to define precisely the source code which must be discovered or ignored (see documentation and org.eclipse.gmt.modisco.java.actions.DiscoverJavaModelFromJa vaProject javadoc).

The Generic XML discoverer is one discoverer which works with any XML file for one generic XML representation (tags, attributes, ...)

The webapp/ejbjar discoverers (in coming Indigo 3.7) are two examples of dedicated xml config files discovery. Those Discoverers classes relies on one small framework : classes DeploymentDescriptorDiscoverer/ProjectDeploymentDescriptorDi scoverer (works on one entire project for looking for xml config files).

I hope these informations will help you. Do not hesitate to browse the MoDisco components help (http://wiki.eclipse.org/MoDisco/Components/v0.9) or to ask for more in this thread.
The incoming Indigo/3.7 Discovery framework will sensibly simplify discoverer writing, but it depends if you can wait until Eclipse Indigo release...


----------------------------------------------------
Fabien GIQUEL
R&D Engineer
Mia-Software
4, rue du Ch√Ęteau de l'Eraudiere
44324 NANTES CEDEX 03
----------------------------------------------------
Re: Reverse Engineering Plugin based on MoDisco [message #655856 is a reply to message #655469] Tue, 22 February 2011 16:03 Go to previous message
Rob is currently offline Rob
Messages: 17
Registered: February 2011
Junior Member
Hi!

Many thanks for the useful hints so far.
Unfortunately I can't wait for the next MoDisco Version to be finished although the JEE Discoverer could be quite useful for my project - especially when it comes to targeting xml configurations within a project. But I don't want to risk problems occurring with missing features or bugs and incompatibilities with tools I use additionally. Especially as v0.9 requires Indigo. At least I will have a closer look into the 0.9 documentation.

I was not aware of the filters (regex) to select the source code. I have to dig into it because I wonder if it would be possible, to select java sources which extend a certain base class or implement certain interfaces provided by the framework - from my point of view a very useful feature in the context of framework based applications.

Thanks
Previous Topic:Code migration to Emf Facet
Next Topic:Editing model from a Java application
Goto Forum:
  


Current Time: Wed Aug 20 07:03:06 EDT 2014

Powered by FUDForum. Page generated in 0.01548 seconds