This section is composed by:
- Java
code
- Create a detailled model including your full
project information
- Create a view of your project
- Merge exiting model
with modified java code
- JPA
annotations
- Database Reverse
- Sequence
diagram reverse
- Reverse engineering
Example
1. Java Code
Import your java code
inside Eclipse then select one of the following option:
1.1 Create a detailled model including your full
project information
We recommend mapping all your project
information inside your model, btw you can also only use the automatic
detection.
The XMI Backup will immediately save
the following java project information:
- Classifiers
- Inheritance
- Associations
- Dependencies
- JPA Annotation
The XMI Backup menu is available in the Package Explorer by selecting
src > Open / Reverse UML > Deep
Reverse > XMI Backup.
This is a heavy refactoring process which requires 12 minutes on my
laptop
(intel duo core 2Ghz - ram
2048) for Xerces
(large
project size composed by over 1 000 classes&Interfaces).
This process will map each piece of Java information into a UML 2.2
model.
This means that 100% of your Java or JEE project skeleton will be
saved.
Please note that if you want to save business rules inside your model,
then you need to manually reverse each method. This reverse is too
heavy to be completed automaticly
(will
require between 12 to 24 hours for xerces) and don't really have
any sens to be done for each method. The best approach is to select
strategic business rules methods and only
reverse
these methods.
1.2
Create a view of your project
The create a view of
your project requires to have java code and use automatic
detection.
You can click on a package and reverse java code immediately at any any
time.
Note that only the created diagram represented by the package and
classifiers
will be saved in the model.
To reverse a package
using automatic detection you can use three options:
- click on the package > New
UML Diagram > UML Class Diagram will allow you to select
classifers from a list and give a name to your diagram
- Click on the package > Open
/ Reverse UML > Class Diagram or Class Diagram View will select all
classifiers from the package and display the selected view (e.g. inheritance, dependencies,
associations and Classifiers with or without compartments).
If you look at the model then you will
notice that only the selected package classifiers and connectors have
been saved in the model.
1.3 Merge existing
model with modified java code
The merge option is an
important concept if the java project is evolving with the creation of
new UML diagrams.
The principe is too reverse the full project at the beginning of the
modeling stage, then to create diagrams and close EclipseUML.
After few weeks of coding another iteration stage is needed.
At this stage the model merge will add all detected new packages,
classifiers and connectors to the exisitng model.
The merge option is
available if you select the src >
Open / Reverse UML > Deep Reverse > Merge Model.
The merge mecanism is working at XMI level
and is repescting the following rules:
- Existing classifiers and connectors are never erased from
the model.
- Each
new package or classifiers are added to the model.
- Existing
Classifiers which doesn't exist anymore in the java code are
automaticly transform into model classifiers and not deleted from
diagrams or from the model.
- Existing
classifiers which are refactored are also immediately renamed/moved in
the model and in each UML diagram when you first time open the editor.
- If
attributes or methods are added or deleted or rename then it is
immediately mapped with the model (e.g.
it means that deleted attributes or methods from the java code are
deleted from the model at this stage).
Please note that if you copy and paste diagrams into another project
then diagrams will not anymore be synchronized with Java or the model.
If you move diagrams inside your project then diagrams will keep the
same properties and will always be synchronized.
2. JPA
Annotations
JPA annotations are
automaticly reversed in both live code/model/UML Editor synchronization.
You can use deep reverse menus (e.g. XMI backup or Merge Model).
For example if you
reverse the following code:
package p;
import javax.persistence.Entity;
import javax.persistence.Id;
@Entity(name="name")
public class JPAEntity {
@Id
private long id;
public long getId()
{
return id;
}
public void setId(long id ){
this.id = id;
}
}
You will get the
following in your class diagram:

3.
Reverse a
database
The use of the Dali plugin with
EclipseUML is required.
The concept is :
Dali plugin connect the database and
reverse it into Java code including annotations.
EclipseUML then reverse these annotations from the code into the UML
Editor and the Model
More information at: Persistence
Development topic