Establish Project References
You are allowed to re-use model elements from dependent project in developing your current project. Moreover, this also helps you to optimize projects through breaking down a project into smaller pieces. Once the project dependency being established, you can develop your model using model elements in dependent project. This tutorial takes Fruit Store project and a library project as an example to explain how does project dependency works.
Reusing a class from another project
- Download the Library.vpp from this tutorial and then store it in your machine in advance.
- Create a new project with VP-UML. Select File > New Project from the main menu.
- In the New Project dialog box, enter Fruit Store as project name. Click Create Blank Project button.

- Open the Model Explorer.

- Right click on the background of Model Explorer and select Manage Dependent Project... from the pop-up menu.

- In the Manage Dependent Project dialog box, click Add button and then select Library.vpp. Click Close button.

- You can see the model elements in Library.vpp on Model Explorer.

- Let's construct a simple class diagram for collection classes. Create a new class diagram first. Click on the UML button in toolbar and select Class Diagram from the pop-up menu.

- Next, create a FruitCollection class which stores the fruit selections in the store. Let's start by reusing the Collection class in Library.vpp. Drag out the Collection class from Model Explorer and drop it on the diagram.

- To create a new class implementing the Collection interface, move the mouse pointer over the Collection class, press and drag its resource icon Realization -> Class.

- Drag under the Collection class and release the mouse button. Name the class as FruitCollection and press Enter.

- Add an operation to the FruitCollection class. Right click on it and select Add > Operation from the pop-up menu.

-
Name the operation +containsApple():boolean, press Enter and Esc to confirm editing.
The first half of this tutorial is finished. The steps above demonstrate how does dependent project(s) execute. Even if in future there are other projects that require the modeling of collection classes, you can reuse the same library project as dependent project. Moreover, when you have updated the dependent project, for example, adding an operation to the Collection class in this case, the depending project will be benefited as well. This time-saving feature would avoid you repeating the same change on different projects.
Indicating dependent shapes
- Click on the button Show Model Element Indicators on the topmost of diagram toolbar.

- Now, have look on the diagram. You can see a tiny arrow icon next to the name of Collection class. This indicates it is a class from dependent project.

Viewing diagrams created in dependent project
- Open the Diagram Navigator.

- Scroll down to the bottom of Diagram Navigator. Expand the node Library > UML Diagram > Class Diagram.
- Double click on diagram node Collection Framework to open it. With this, you can read the diagram drawn in the dependent project.

Resources
- Library.vpp
Rate this Article
Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).
One Moment Please
Thanks for rating this article.
Comments (0)