C# Round-trip engineering

Visual Paradigm's Visual Studio integration enables you to design your system with class diagram and generate code. On the other hand, you can update changes made in code back to the model. This make sure both the design and source code are updated.

November 22, 2010
User Rating: / 2
Views: 2,940
PDF Link Add comments
Edition: Standard or above (Edition comparison)

  1. Select New > Project... from the main menu of Visual Studio.
    new project
  2. In the New Project dialog box, select Class Library as template, enter PhoneBook as project name click OK.
    name project
  3. In the Solution Explorer, right click on the project PhoneBook and select Open VP-UML from the popup menu.
    open VP-UML
  4. Click OK when the project structure dialog box appears.
  5. From the Diagram Navigator, right click on Class Diagram node and select New Class Diagram from the popup menu. This creates a blank class diagram.
    new class diagram
  6. Select Class from the diagram toolbar.
    select class
  7. Click on the diagram to create a class. Name it as Book and press Enter to confirm editing.
    book created
  8. Right click on the Book class and select Add > Attribute from the popup menu.
    new attribute
  9. Input name : String and press Enter.
  10. Input description : String and press Enter. Press Esc to confirm editing.
    attribures added
  11. A phone book contains many contacts. Let's create a Contact class from the Book class with an association. Move the mouse pointer over the Book class. Press on Association -> Class and drag it out.
    create class
  12. Release the mouse button and name it as Contact.
    create contact
  13. Right click on the Contact class and select Add > Attribute from the popup menu.
    new attribute
  14. Input name : String and press Enter.
  15. Input age : int and press Enter.
  16. Input phoneNum : String and press Enter. Press Esc to confirm editing.
    attribures added
  17. Select Update Code from Diagram Navigator. You can see that two code files are generated.
    update code
  18. Add an operation printInfo in the source code of Book class.
    add operation
  19. Right click on the code editor and select Update UML Model from the popup menu.
    You can see that the operation printInfo() is added to the Book class at UML model side.
    oper added

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. Draw Entity Relationship Diagram (ERD)
    Tagged:
  3. UML Package Diagram
    Tagged:
  4. Produce UML Use Cases from Business Process Diagram (BPD)
  5. Oracle database design with Entity Relationship Diagram
Tags of this article:

Comments (0)

Write comment

Rating

Comment

Enter the calculation result

security code