Model a Java Project with no Java code  :-)

It is possible to create a full and complex model with EclipseUML 2008 and not create any Java element inside a Java project.
This is important for first modelling stage which certainly should be disassociated from the code.
For more information see our MDA Jee project at:
We can say MDA because we don't create any Java element and just use metamodel elements from Class, UseCase and State diagrams.

Many users don't understand why we should create a Java project at this modeling stage !!
If you just model at higher level of abstraction, and don't know what will be your target (java, dotnet, C etc...) then you either only get a blue print from your UML model or you need over 30% of extra work to transform UML to Java/Jee code and keep it updated.
Both solutions (blue print or adding extra 30% job) are for our point of view not appropriate if at the beginning of the project you already know that Java/Jee/JPA is the deployment target.
We understand it is painful for modelers to have to create a Java/Jee/JPA project at this requirement modeling stage, but this is the only way to use UML modeling in an agile project and create a real interactivity between UML and Java.
Our strategy is therefore to increase interactivity between UML and Java/Jee/JPA.
The only way to do this is to immediately start with a Java, EJB, JPA ... projects at modeling stage even if no java code is created.

The following technical documentation is composed of:
  1. How to create a package diagram
  2. How to create a UML package
  3. How to rename a UML package
  4. How to created nested UML package
  5. How to create UML classes
  6. How to organise your project element inside packages

1. How to create a package Diagram

Create a project and a src inside Eclipse 3.4 Ganymede.
Click on the src > New > Package Diagram

2. How to create a UML Package

Click in the diagram background and select Next > Package > UML Package

The UML package (e.g. Package1) has been created in the model with no java code.

3. How to rename an UML package

Click on the diagram background (do not select any element with your mouse) and select Show View > Properties

Click inside the Property View and enter the new name of the package in the Name field.

4. How to create a nested package

Create a new UML Package and just drag and drop the new created package inside the other package.
Immediately the model (e.g. xmi editor on the right side of the picture) is updated.

5. How to create a UML Class

Click on the diagram background and select New > Class > UML Class
The Class has been created with no java code.

6. How to organise your project inside packages.

The graphical drag and drop inside the UML editor will immediately update the UML model.
If you drag and drop Class1 inside Package1 then you will have the picture below:

The package diagram is saved at the root of the src in the package explorer.

You can organize your diagrams and move all UML elements in any new package located in the same project.
The model refactoring is always immediately activated.


You can model very complex MDA projects without any java code generation with EclipseUML 2008.
The only constraint is the need to create an initial Java, JPA, EJB etc...project and not only a modelling project.