Chapter 3 Building Physical Diagrams


Defining a generation order for views

You can use extended dependencies to define an order in the generation of views.

Extended dependencies are free links between PDM objects. These links help to make object relationships clearer between model objects. Usually, these links are not interpreted and checked by PowerDesigner as they are meant to be used for documentation purposes only. However, if you assign the <<DBCreateAfter>> stereotype to an extended dependency between views, it will be analyzed during generation.

The view from which you start the extended dependency is the dependent view and the view at the other end of the link is the influent view. The influent view will be generated before the dependent view.

Circular extended dependencies

If you create a reflexive and/or circular set of extended dependencies with the <<DBCreateAfter>> stereotype, an error message appears during the check model. If you choose to ignore this error, the views will be generated in alphabetical order, without taking into account the generation order, which could cause errors in the creation of views in the database.

Example

You create the view DEPARTMENT STORE from the table STORE. The view retrieves information from the table as you can check in the SQL Query page of the view property sheet:


You decide to create another view called COMPUTER COUNTER to show only part of the department store offer. This view is created from the view DEPARTMENT STORE, and retrieves information from it.

By default views are generated in alphabetical order, so the generation of COMPUTER COUNTER will fail since the view DEPARTMENT STORE from which it depends is not generated. To bypass this problem, you can create a extended dependency with the <<DBCreateAfter>> stereotype from COMPUTER COUNTER to DEPARTMENT STORE.


This allows you to set an order in the generation of views: DEPARTMENT STORE will be generated before COMPUTER COUNTER.

You can create an extended dependency between views from the list of views or from the diagram.

For more information on how to create views from a list, see the "Defining a generation order for stored procedures" section in the Building Triggers and Procedures chapter.

Steps To define a generation order for views from the diagram:

  1. Select the Extended Dependencies tool in the palette.
  2. Click inside the dependent view and while holding down the mouse button, drag the cursor into the influent view. Release the mouse button.
  3. Double-click the extended dependency link.

    The dependent view property sheet opens to the Extended Dependencies tab. you can check that the influent view appears in the Influent Object column of the list of extended dependencies.
  4. Click inside the Stereotype column, click the down arrow and select <<DBCreateAfter>> in the dropdown listbox.
  5. Click OK.

For more information on extended dependencies, see Using Extended Dependencies in the General Features Guide .

 


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