![]() ![]() ![]()
|
Chapter 5 - Integration with JDeveloper
Overview
![]()
VP-UML Professional and Enterprise Edition allows you to integrate the VP-UML module with Oracle JDeveloper, providing full software development life cycle support. By designing your software system in VP-UML, you can generate programming source code from class diagram to a JDeveloper project. Also, you can reverse engineer your source code into class models in VP-UML.
Installation
First of all, please make sure your machine has Oracle JDeveloper 10g or above properly installed.
To install JDeveloper Integration from VP-UML:
- Start VP-UML
- Select Tools > IDE Integration... from the main menu of VP-UML.
![]()
- This displays the VP-Suite dialog box.
![]()
- Check JDeveloper Integration.
- Click Next. This displays the Product Configuration page.
- Locate the JDeveloper home directory in the Directory field. You can enter the path directly in the text field, or press ... to select the directory from the Open dialog box.
- Click Next. This displays the Installing Files page and starts the installation process.
![]()
- Click Finish to close the dialog box when the installation is completed.
Creating a VP-UML Project in JDeveloper
To create a VP-UML Project in JDeveloper:
- Start JDeveloper.
- Select the JDeveloper project for which you want to create a VP-UML project for it.
- Right-click on the selected project and choose New VP-UML %EDITION% Project from popup menu.
![]()
This displays the Project Structure dialog box.
![]()
- Select from the Project Structure dialog box the location of the VP-UML project is to be saved. The VP-UML project, with .vpp extension, is the UML project file that is going to be associated with the selected JDeveloper project file. Select Create in default path result in saving the VP-UML project to % JDeveloper_Project_Directory%/vpproject while selecting Create at external location require you to specify the project path.
- Click OK.
This starts a new instance of VP-UML on a separate window. The project opened from VP-UML is associated with the JDeveloper project.
![]()
Opening a VP-UML Project from JDeveloper
- Start JDeveloper.
- Select the JDeveloper project for which you want to open the VP-UML project from it.
- Right-click on the selected project and choose Open VP-UML %EDITION% Model from popup menu.
![]()
This starts a new instance of VP-UML on a separate window. The project opened from VP-UML is associated with the JDeveloper project.
Reverse Engineering from Code to Model
Code reverse engineering updates UML class models from source code in JDeveloper. You can update the whole project, package (s) and class (es) from JDeveloper to VP-UML. Before reverse engineering, you must open the UML model of the desired project. More information about how to open a VP-UML from JDeveloper can be found from the section Opening a VP-UML Project from JDeveloper in this Chapter.
Project Based Reverse Engineering
You can update models in VP-UML from an JDeveloper project. Models of the selected project, child packages and classes will be updated or created (if the models are not already exists).
To reverse engineer code from an JDeveloper project to UML model, right-click on the project node in JDeveloper and select Update VP-UML %EDITION% Model from popup menu.
![]()
This updates/creates the corresponding UML model in VP-UML.
Package Based Reverse Engineering
You can update models in VP-UML from a JDeveloper project. Models of the selected package, child packages and classes will be updated or created (if the models are not already exists).
To reverse engineer code from a package in a JDeveloper project to UML model, right-click on the package in JDeveloper and select Update VP-UML %EDITION% Model from popup menu.
![]()
This updates/creates the corresponding UML model in VP-UML.
Class Based Reverse Engineering
You can update models in VP-UML from a JDeveloper project. Models of the selected class and child classes (inner class) will be updated or created (if the models are not already exists).
To reverse engineer code from a class in a JDeveloper project to UML model, right-click on the class file in JDeveloper and select Update VP-UML %EDITION% Model from popup menu.
![]()
This updates/creates the corresponding UML model in VP-UML.
Selecting Corresponding Elements in VP-UML from JDeveloper
VP-UML helps selects class models in VP-UML corresponding to the source code in JDeveloper. To select corresponding models in VP-UML from JDeveloper, perform one of the following actions:
- Select on the desired piece of source elements from either the System Navigator or Applications Navigator of JDeveloper. Right-click on the selection and choose Select in VP-UML %EDITION% Project from popup menu.
![]()
- When the code editor for the desired piece of source is active, choose VP-UML %EDITION% > Select in VP-UML %EDITION% Project from JDeveloper main menu.
In both cases, the corresponding model in VP-UML is selected.
![]()
Code Generation from Model to Code
Code generation creates/updates source code in a JDeveloper project from UML models. You can select to update the whole project, package (s) and class (es) from VP-UML to JDeveloper. Before updating/generating code, you must open the UML model of the desired project. More information about how to open a VP-UML from JDeveloper can be found from the section Opening a VP-UML Project from JDeveloper in this Chapter.
Furthermore, there are 2 ways in synchronizing (updating) model to code. They are Sync to Code and Force Sync to Code.
Sync to Code
Removed sources will not be recovered. Only the existing sources will be synchronized with the UML models.
Force Sync to Code
Removed sources will be recovered. Existing sources will be synchronized with the UML models, while removed sources will be reconstructed.
Project Based Code Generation
To generate all classes and/or packages within a UML project:
Package Based Code Generation
To generate a package together with class/classes inside:
Class Based Code Generation
To generate class/classes:
Selecting Corresponding Elements in JDeveloper from VP-UML
VP-UML helps selects element in VP-UML corresponding to the source code in JDeveloper. To select corresponding piece of source code in JDeveloper from VP-UML, perform one of the following actions:
- Select on the desired UML model in the Diagram Navigator, in the Model Tree or in the Class Repository Tree. Right-click on the selection and choose Select in JDeveloper from popup menu.
![]()
- Select the desired model for generating code on a class diagram. Right-click on the selection and choose Select in JDeveloper from popup menu.
In both cases, the corresponding source files will be opened and activated in JDeveloper.
![]()
Importing a VP-UML Project into JDeveloper
You can import another VP-UML project into a JDeveloper project. If there is a VP-UML associating with the JDeveloper project, importing a VP-UML project results in replacing the original one with the one going to be imported.
Before importing a VP-UML project, you must open the UML model of the desired project. More information about how to open a VP-UML from JDeveloper can be found from the section Opening a VP-UML Project from JDeveloper in this Chapter.
To import a VP-UML project:
- Select the JDeveloper project for which you want to import a VP-UML project into it.
- Right-click on the selected project and choose VP-UML %EDITION% > Import VP-UML %EDITION% Project from popup menu.
![]()
- This displays the Import Project dialog box.
![]()
- Locate the file path of the source VP-UML project. The source project is the one that is going to be imported into the selected JDeveloper project. If there is an existing VP-UML project associated with the selected JDeveloper project, the target project path is the path of the existing VP-UML project. If there is no existing VP-UML project associated with the selected JDeveloper project, the path is the default one, which is %JDeveloper_Project_Directory%/vpproject.
- Click OK.
This starts a new instance of VP-UML on a separate window. The project opened from VP-UML is the imported one which is now associated with the JDeveloper project.
![]()
Exporting a VP-UML Project from JDeveloper
You can export the VP-UML project that is associated with a JDeveloper project. The exported VP-UML project has no association with both the JDeveloper project and the VP-UML project it exported from.
Before exporting a VP-UML project, you must open the UML model of the desired project. More information about how to open a VP-UML from JDeveloper can be found from the section Opening a VP-UML Project from JDeveloper in this Chapter.
To export a VP-UML project:
- Select the JDeveloper project for which you want to export the VP-UML associated with it.
- Right-click on the selected project and choose VP-UML %EDITION% > Export VP-UML %EDITION% Project from popup menu.
![]()
This displays the Save As dialog box.
- Locate the project file path for the output project.
- Click Save.
The VP-UML project is exported to the specified location.
Model Representation of Code
The following table shows some of the model representation of code.
![]() ![]()
|
| Visual Paradigm International Limited | |
| Website: | www.visual-paradigm.com |
| Tel: | +852 2744-8722 |
| Fax: | +852 2744-6722 |
| Contact: | support@visual-paradigm.com |