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.

August 16, 2010
User Rating: / 0
Views: 1,603
PDF Link Add comments
Edition: Standard or above (Edition comparison)

Reusing a class from another project

  1. Download the Library.vpp from this tutorial and then store it in your machine in advance.
  2. Create a new project with VP-UML. Select File > New Project from the main menu.
  3. In the New Project dialog box, enter Fruit Store as project name. Click Create Blank Project button.
    prj name
  4. Open the Model Explorer.
    open model explorer
  5. Right click on the background of Model Explorer and select Manage Dependent Project... from the pop-up menu.
    manage dep prj
  6. In the Manage Dependent Project dialog box, click Add button and then select Library.vpp. Click Close button.
    manage dep prj
  7. You can see the model elements in Library.vpp on Model Explorer.
    model explorer updated
  8. 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.
    create class diagram
  9. 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.
    drag class
  10. 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.
    create realization
  11. Drag under the Collection class and release the mouse button. Name the class as FruitCollection and press Enter.
    fruit collection created
  12. Add an operation to the FruitCollection class. Right click on it and select Add > Operation from the pop-up menu.
    new oper
  13. Name the operation +containsApple():boolean, press Enter and Esc to confirm editing.
    diagram complete
    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

  1. Click on the button Show Model Element Indicators on the topmost of diagram toolbar.
    show indicators
  2. 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.
    arrow appear

Viewing diagrams created in dependent project

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

Resources

  1. Library.vpp

Rate this Article

Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).

You may be interested in

  1. Writing Effective Use Case
  2. UML Package Diagram
    Tagged:
  3. Draw Entity Relationship Diagram (ERD)
    Tagged:
  4. Produce UML Use Cases from Business Process Diagram (BPD)
  5. Draw UML Sequence Diagram with Keyboard
Tags of this article:

Comments (0)

Write comment

Rating

Comment

Enter the calculation result

security code