Together User Guide:
 
Chapter 
2
Class Diagrams

CHAPTER CONTENTS 
 

About Class diagrams

Main Class diagram elements

Working with Class diagrams

Working with Packages

    1. Right click on the package node in the Navigation pane.
    2. Choose Browse to open the diagram in the current Object Model Browser window, or Browse in New Window  to open it in a new browser window.

    Usage links

    When you choose Update Package Links on the diagram context menu, Together scans each package on the diagram.  If it finds an element within the package that is linked to an element of another package, then it creates a usage link between those package icons on the diagram.
    This covers only source-code based elements. Such elements as Objects, Notes, and elements of proper diagrams (e.g. Imported class or Use Case), even if they have interpackage links, do not result in recognizing Usage links between the corresponding packages.
    NOTE: Usage links are filtered off by default. Go to the Inspector, and switch in the Display tab (upper), Link tab (lower) usage dependency to show. If you draw a Dependency link between packages it is shown independently of this filter. Manual dependency links are shown/hidden by another filter (manual dependency).
     

     Moving nodes into Packages

    Classes and interfaces can be visually moved to other Packages by dragging from the diagram to the target package.  For more information, see Moving elements. Other packages, imported or compiled classes or interfaces cannot be moved in this way however. Pressing the CTRL key and dragging a class into a package  imports the class into that package. The class name in italic appears in the package icon.

    By default the package icon on the diagram displays its updated contents. You can use the class/interface context menu and add attributes and operations directly. The diagram option Subpackages controls how the packages are displayed in the diagram.

     

    Moving nodes from Packages

    By dragging the class or interface name from the package element to the diagram background, you can move that class or interface to the current diagram, deleting it from its current package and moving it to its new package. Pressing the CTRL key and dragging a class from a package imports the class to the current diagram. The imported class icon appears.
     

    Renaming a Package

    You can rename a package using the Inspector or in-place. This change is propagated to all the source files in the opened packages. If a class in another package is linked with a class in the package being renamed, the link is kept.
    However, the propagation is not performed in the sources in the packages that are not opened at the moment of rename. You should correct there the package statements and/or class qualified names manually or use Tools | Scan all diagrams command to enforce opening all the diagrams and packages in the project.
    You can only delete a package using its context menu if all of its contents have been removed first.
     

    Deleting a Package

    You can only delete a package using its context menu if all of its contents have been removed first.
     

Working with Logical Packages

    Creating a logical package

    1. In the Navigation pane,  select the physical package for in which you want to create a new logical package and choose New Diagram from its context menu.
    2. In the New Diagram dialog choose the Logical Package option and specify a name for the logical package.
    3. Browse into the newly created logical package to begin working on its diagram (this is a .vfClass type diagram).

    Creating nodes in the Logical Package

    This works in the same way as the physical package, but when you add a node to the .vfClass diagram, it also appears on the top-level diagram of the package for which it was created.  If you try to create a package to the .vfClass diagram, it  appears on both diagrams as well.  Source code is always generated at the physical level where the logical package's .vfClass file resides.
     

    Moving nodes into Logical Packages

    When you drag a class or interface onto the logical package icon, it is hidden on that diagram and displayed on the logical view.  It can be shown by using the Show Hidden... command on the diagram context menu.  Unlike the Package, you can drag imported nodes onto the logical package icon.
     

    Moving nodes from Logical Packages

    When you drag a class or interface name from the Logical Package icon, it is removed from the view and displays on the diagram, but it is not deleted.
     

    Deleting a Logical Package

    Unlike the Package, a Logical view can be deleted even if it has contents because its contents are only views of the classes, etc.
 

Working with Classes and Interfaces

Working with Links


Chapter contents



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)