Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "MoDisco/JavaDiscoverer"

(Team)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The goal of Java Discoverer plugin is to allow practical extractions of [[MoDisco/J2SE5|J2SE5 models]] from a Java project.
+
#REDIRECT [[MoDisco/Moved To Help Center]]
The J2SE5 models could also be converted in [[MoDisco/KDM|KDM models]] ([http://www.omg.org/technology/kdm/index.htm OMG specifications]).
+
 
+
 
+
== Description ==
+
 
+
This plugin aims at analysing Java source code compliant with J2SE 5.0 standard and providing a model describing the information found. As shown in next figure, this model can conform either to the [[MoDisco/J2SE5|J2SE5 metamodel]] or to the [[MoDisco/KDM|KDM metamodel]].
+
 
+
[[Image:JavaDiscovererOverview.jpg|frame|center|Overall approach of the J2SE5 discoverer]]
+
 
+
 
+
The [[MoDisco/J2SE5|J2SE5 model]] is built from the source code by a Java component using the [[JDT|JDT]], while the [[MoDisco/KDM|KDM model]] is built by a model transformation (powered by [[ATL|ATL]]) applied on the [[MoDisco/J2SE5|J2SE5 model]].
+
 
+
The [[MoDisco/J2SE5|J2SE5 model]] contains the full abstract syntax tree of the Java program : each statement such as attribute definition, method invocation or loop is described. In addition, links between elements are resolved (by resolved link we mean for instance a link between a method invocation and the declaration of this method, or the usage of a variable and its declaration). The model can thus be seen as an abstract syntax graph (ASG).
+
+
The [[MoDisco/KDM|KDM model]] represents only the structure of the Java application. The mapping between Java concepts and elements of [[MoDisco/J2SE5|J2SE5]] and [[MoDisco/KDM|KDM]] metamodels is described in the following table.
+
 
+
[[Image:Modisco-J2SE5toKDMmapping.jpg|frame|center|J2SE5 to KDM mapping]]
+
 
+
In this version, the only data flow elements (below the method declaration) described in the [[MoDisco/KDM|KDM model]] are :
+
• The creation of instances (Creates)
+
• The method invocations (Calls)
+
• The return statements returning a variable (UsesType)
+
 
+
The mapping to [[MoDisco/KDM|KDM]] can be changed or completed easily by updating the [[ATL|ATL]] rules.
+
 
+
 
+
== Requirements ==
+
 
+
To use the plug-in you need:
+
* JDK 1.5 or above
+
* a version of Eclipse 3.3 or above with the following set of plugins installed
+
:* [[EMF|EMF]] 2.3.0 or higher
+
:* [[ATL|ATL]] 2.0.0 or higher
+
:* [[MoDisco/J2SE5|J2SE5 metamodel]]
+
:* [[MoDisco/KDM|KDM metamodel]]
+
 
+
 
+
== Team ==
+
Gabriel Barbier ([http://www.mia-software.com Mia-Software])
+
 
+
Fabien Giquel ([http://www.mia-software.com Mia-Software])
+
 
+
Frédéric Madiot ([http://www.mia-software.com Mia-Software])
+
 
+
== Install ==
+
 
+
You will find a version of this plug-in attached in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=258281 following bug].
+
 
+
As IP review of this plugin is not finished, here is installation instructions :
+
 
+
* Extract archive file in your Eclipse workspace, then use "import" menu to import this project.
+
* Use "export" menu to export this project as a plugin (Deployable plugins and fragments) in your Eclipse installation. Don't forget to choose "Package plug-ins as individual jar archives" option.
+
* re-start your Eclipse to take in account this plug-in
+
 
+
== User manual ==
+
 
+
The plugin provides the user with a contextual menu to easily create models.
+
 
+
By right-clicking on a Java Project in the Eclipse Package Explorer view, you can quickly create the J2SE5 or KDM model of your application (see next Figure). Each of these models can then be used with any other tool compliant with the corresponding metamodel.
+
 
+
+
[[Image:MoDisco-JavaDiscoverer popup menu.jpg|frame|center|Menus in Eclipse to create models from source code]]
+
 
+
If you want to create a KDM model using an existing J2SE5 model, you can also right-click on a J2SE5 model file and select “Convert J2SE5 to KDM Model” in the contextual menu (see next Figure).
+
 
+
+
[[Image:MoDisco-JavaDiscoverer J2se5 to Kdm popup menu.jpg|frame|center|Menus in Eclipse to create KDM model from J2SE5 model]]
+
 
+
A progress bar will appear at the bottom of the window as soon as the operation begins. Depending on the size of your application, the reverse engineering and transformation might take some time to complete (see next Figure).
+
+
 
+
[[Image:MoDisco-JavaDiscoverer progress bar.jpg|frame|center|Progress bar during models creation]]
+
 
+
At the end of the process, the newly created model files are added at the root of your project and are automatically opened in the default editor (see next Figure).
+
 
+
[[Image:MoDisco-JavaDiscoverer J2se5 and KDM models.jpg|frame|center|KDM model in the package explorer]]
+
 
+
.kdm files and .j2se5 files could be opened in the Sample Reflexive Ecore Model Editor (see next Figure).
+
 
+
[[Image:MoDisco-JavaDiscoverer J2SE5 and KDM model in EMF browser.jpg|frame|center|J2SE5 and KDM models viewed with EMF browser]]
+
 
+
They could also be opened in MoDisco model browser (see next Figure) which brings some graphical improvements.
+
 
+
[[Image:MoDisco-JavaDiscoverer example J2SE5 SimpleModel.jpg|frame|center|J2SE5 model viewed with MoDisco browser]]
+
[[Image:MoDisco-JavaDiscoverer example KDM SimpleModel.jpg|frame|center|KDM model viewed with MoDisco browser]]
+
 
+
== Current limitations ==
+
 
+
Links to unresolved types (types whose declaration is available neither in source code nor in a library) are not created in the KDM model. This should be fixed in the next version.
+
 
+
The actual transformation to KDM creates only the elements describing the structure of the Java application. It means that the instructions contained within a method are not transformed into KDM elements (except instance creations, method invocations and return instructions).
+
 
+
Some particular cases are not yet managed by the transformation:
+
• generic types
+
• enumerations
+
• anonymous classes and any class or interface which is not directly contained in a package.
+
 
+
Those limitations could be managed in future versions. As soon as this project will be available in SVN, a patch will be submitted to correct "generic types" and "anonymous classes" limitations.
+

Latest revision as of 06:13, 4 April 2012

  1. REDIRECT MoDisco/Moved To Help Center

Back to the top