Chapter 5 Managing Models


Converting a diagram to a package

When a package begins to reach a critical size, it is useful to reorganize it into sub-packages using diagrams.

PowerDesigner lets you convert a diagram to a package using the Convert Diagram to Package wizard from the View→Diagram submenu. You can replace the existing diagram with a new sub-package in order to simplify the source diagram. This process moves the diagram and the objects it contains from its source package to a new sub-package. The diagram must contain symbols in order to display the Selecting Objects to Move page of the wizard and proceed to the convert.

When you convert a diagram to a package, object symbols of the diagram are always moved to the package. Objects themselves are either moved or replaced by a shortcut.

The linking objects that you move keep their links in the target package and a shortcut is usually created in the source package. The general rule being that conceptual modeling must be preserved.

Shortcuts creation rules in PowerDesigner also apply to moving objects between packages.

For more information on shortcut creation, see chapter Managing shortcuts.

PowerDesigner lets you select the objects of the diagram you want to convert to a package using the Selecting Objects to Move page of the wizard. Only relevant tabs are displayed. For example, if you convert to package a diagram that only contains tables and references, only the Table tab will be available, as the reference is contained in the table definition. Besides, when you deselect two objects related with an oriented link, the link is automatically deselected (for example two classes with an association link or two entities with a relation link). Just as when you deselect a non-oriented link, ending objects are automatically deselected. Also, objects that do not support shortcuts do not appear in the selection page as they are always moved with diagram.

Moving entities

For entities containing data items, the following situations can occur when you move the entity:

Data items Namespace Move result
Only used by selected entity Move within the same namespace The data items are moved with the entity
Reused among different entities Move within the same namespace Shortcuts of data items are created for reused data items
Used only by one entity or reused among different entities Change namespace Data items are copied in the other namespace

Steps To convert a diagram to a package:

  1. Select View→Diagram→Convert to Package.

    or

    Right-click the diagram background window and select Diagram→Convert to Package from the contextual menu.

    or

    Right-click the diagram node in the Model Explorer and select Convert to Package from the contextual menu.

    The Convert Diagram to Package page appears. By default the sub-package takes the name of the diagram.
  2. Type a name and a code for the new package.
  3. Click Next.

    The Selecting Objects to Move page appears. It displays all relevant tabbed pages. By default, all the objects are selected.

    When you deselect objects in the selection list, other object selections are not affected.

    For more information on how to select items in a selection list, see section Adding an item from a selection list in chapter Using the PowerDesigner interface.
  4. Click Finish, if you want all the selected objects to be moved into the sub-package.

    or

    Deselect the objects you do not want to be moved to the sub-package and click Finish.

    The selected objects are moved to the sub-package.

 


Copyright (C) 2005. Sybase Inc. All rights reserved.