Jump to Menu

How to Create Project Reference in Visual Paradigm?

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 reference being established, you can develop your model using model elements in referenced project. This tutorial takes Fruit Store project and a library project as an example to explain how does project referencing works.

Compatible edition(s): Enterprise, Professional, Standard

  • February 22, 2016
  • Views: 27,063
  • PDF

Reusing a class from another project

  1. Download the Library.vpp and then put it under your workspace folder. You can check your workspace folder path selecting Help > Switch Workspace from the application toolbar.
  2. Create a new project with Visual Paradigm. Select Project > New from the application toolbar.
  3. In the New Project window, enter Fruit Store as project name. Click the Create Blank Project button.
    New project
  4. Select Project > Referenced Project from the application toolbar.
  5. In the Manage Reference Project window, click Add button and then select Library.vpp. Click Close button.
    Manage referenced project window
  6. You can see the model elements in Library.vpp listed in the Model Explorer. On top of the element list there is a drop down menu for you to access the elements in different referenced projects. You will need it when your project is referencing multiple projects.
    Model Explorer
  7. Let's construct a simple class diagram for collection classes. Create a new class diagram first. You can create a class diagram by selecting Diagram > New from the application toolbar. Select Class Diagram and click Next. Then, click OK to confirm.
    Creating class diagram
  8. Let's 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 reuse a class from referenced project
  9. To create a new class that implements the Collection interface, move the mouse pointer over the Collection class, press and drag on the Resource Catalog button.
    Using Resource Catalog
  10. Release the mouse button and select Realization -> Class from Resource Catalog.
    Selecting realization
  11. Name the class as FruitCollection and press Enter.
    Subclass created
  12. Add an operation to the FruitCollection class. Right-click on it and select Add > Operation from the pop-up menu.
    Adding operation
  13. Name the operation +containsApple():boolean, press Enter and Esc to confirm editing.
    Updated class diagram
    The first half of this tutorial is finished. The steps above demonstrate how does reference project(s) work. Even if in future there are other projects that require the modeling of collection classes, you can reuse the same library project as referenced project. Moreover, when you have updated the reference project, for example, adding an operation to the Collection class in this case, the referencing project will be benefited as well. This time-saving feature would avoid you repeating the same change on different projects.

Accessing diagrams in referenced project

  1. Select View > Project Browser from the application toolbar.
  2. Under the Diagram tab, click on the drop down menu at the top left corner and then select the Library project.
    Browsing referenced project
  3. Double click on the diagram Collection Framework to open it.
    Opening a diagram
    With this, you can read the diagram drawn in the referenced project.
    Diagram in referenced project

创造美好 共同成长

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.