Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsReverse Engineering Plugin based on MoDisco
https://www.eclipse.org/forums/index.php/mv/msg/204924/655435/#msg_655435
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.]]>Rob2011-02-20T23:07:14-00:00Re: Reverse Engineering Plugin based on MoDisco
https://www.eclipse.org/forums/index.php/mv/msg/204924/655466/#msg_655466
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 Bruneliere2011-02-21T10:01:21-00:00Re: Reverse Engineering Plugin based on MoDisco
https://www.eclipse.org/forums/index.php/mv/msg/204924/655469/#msg_655469
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).
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 Giquel2011-02-21T10:04:07-00:00Re: Reverse Engineering Plugin based on MoDisco
https://www.eclipse.org/forums/index.php/mv/msg/204924/655856/#msg_655856
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.