Creating a project

 

Introduction

Objecteering provides Eclipse users with an easy way of integrating UML modeling with Java development. With the Objecteering for Eclipse plugin, you can:

·         add Objecteering functionalities (model construction from reversed code or binaries, Java code generation from UML, multi-user capabilities) to new or existing Java projects

·         generate Java projects from existing Objecteering projects, with the UML model being kept fully synchronized with the Java code

 

UML model integration happens at project level, and for each Java project inside the Eclipse workspace or in an external folder there must be an Objecteering project file (.ofp) located in the project folder root. The name of the .ofp file must be the same as the name of the Java project.

 

Several .ofp file parameters have to be defined and kept synchronized with the Java project parameters, and certain limitations apply.

 

The most important parameters concern the numerous paths that have to be set in both projects:

·         The root of the Java project in Eclipse must be the same as the Genroot in Objecteering.

·         The path to the bin (Java buildpath) must be set for both the "Compilation"/"Compiled file root" parameters in Objecteering.

·         The src (Java source folder) must coincide with the code generation root in the Java Developer MDA component "Generation" parameter set and the application source path in the Java Developer MDA component "Reverse" parameter set.

 

Note:      Only one folder for sources is permitted.

 

·         The classpath for both projects must be the same, since this parameter applies to both code generation and reverse.

 

Objecteering needs a Java JDK in order to function properly, and this implies that the configured JRE for the Eclipse workspace must be changed to a compatible JDK, after this is installed. The setting will be applied to the JDK path setting of Objecteering Java Developer MDA component.

 

And last but not least, Objecteering provides the possibility of generating Javadoc content for a model, and the Javadoc location for the project is also set via the "Generation directory" parameter in the "Documentation" parameter set.

 

These settings can be automatically set at project startup by means of several Wizards that set-up the project workspace accordingly. Three possibilities exist:

·         The user creates a Java project and an Objecteering project from scratch using the "Objecteering/Java Project" wizard

·         The user creates an Objecteering project from a Java project using the "Integrate Java and Objecteering project" wizard

·         The user creates a new Java project from an existing Objecteering project using the "Java project from Objecteering project" wizard

 

 

Launching a wizard

To launch a wizard, right click on the Java navigator view, and from the pop-up menu choose “New” or use the classic method from the “File” menu on the main bar, by choosing “New” and then “Project”.

 

The "New/Project" menu

 

The "New Project" Eclipse window then appears, in which you can choose which wizard you want to use.

 

 

Creating a Java project and an Objecteering project from scratch

 

To create a Java project and an Objecteering project from scratch, start by selecting the “Objecteering/Java Project” wizard in the "New Project" window, as shown below.

 

Selecting the "Objecteering/Java Project" wizard from the list of available Objecteering wizards

 

This wizard creates an empty Java project with a new Objecteering project and prepares it for work in Eclipse.

 

The fist window to appear is similar to the one used when creating a Java project.  This window is used to enter a project name, and potentially to change other sensitive settings such as location, JRE and project layout.

 

Entering a project name

 

After entering the required name, press "Next" to open the second window in which you can change the properties of the Java project.

 

Warning! In order for the Objecteering plug-in to work, the JRE used by Eclipse should point to a JDK. Please check the Eclipse documentation about setting the JRE parameter.

 

Configuring the Java project

 

Once you have completed the configuration of the Java project, press "Finish".  The Java project is then created, inside which a new Objecteering project is also created with the Java Developer MDA component already deployed.

 

Creating the repository

 

 

Once the repository has been created, the Objecteering perspective is opened and the Objecteering editor opens the newly created Objecteering project, as shown below.

 

 

Opening the repository

 

 

Creating an Objecteering project from a Java project

 

To create an Objecteering project in an existing Java project, select the “Objecteering project from Java project” wizard in the list of available Objecteering wizards, as shown below. 

 

Selecting the "Objecteering project from Java project" wizard from the list of available Objecteering wizards

 

The wizard then opens the "New Objecteering File Repository" window, which displays a tree containing the Java projects contained in the current workspace.  Those that already have Objecteering projects deployed inside them are shown in gray. Simply choose the project inside which you want to create the Objecteering file and then press "Finish".

 

The "New Objecteering File Repository" window

 

The Objecteering project is then created and opened. The existing Java source files are reversed.

 

Note:      Objecteeering does not manage multiple source directories. Only the first source directory will be reversed.

 

 

Creating a new Java project from an existing Objecteering project

If you want to create a new Java project from an existing Objecteering file, simply choose the “Java project from Objecteering project” wizard from the list of available Objecteering wizards, as shown below.

 

Selecting the "Creating a Java Project from Objecteering" wizard from the list of available Objecteering wizards

 

The wizard then opens the "Java project from Objecteering project" window (as shown below), in which you can browse for an Objecteering file, using the browse button. The file path will be displayed, and if the file is accessible, the Objecteering icon will be lit up on the left of the file path.

 

You can also select a different folder in which to create the project.

 

Selecting Objecteering and Java project paths

 

When you press "Finish", a new Java project will be created based on the Objecteering file name, and the Objecteering file will be copied into the designated project folder.  At the end of this process, the Objecteering editor will be opened, and the elements that own a Java work product will be generated.

 

For the newly created Java project, the JRE will be set to the default workspace setting, and the parameter set in Objecteering will be ignored.  In order to be able to use Objecteering JDK dependent features, you should simply change the default workspace setting to an installed JDK before running the wizard.