Switch to standard view 
  Sybase logo

Tapping the power of PowerDesigner 7.x Extended Attributes



PowerDesigner 7.5 supports a feature called Extended Attributes.  This feature allows you to extend the attributes which PowerDesigner maintains for any given object.  For example PowerDesigner does not have a field to capture whether a table is a Global Temporary Table in Adaptive Server Anywhere.  With an extended attribute, we can add a location to hold this piece of information to every table object and also adds a mechanism for accessing the values in this location when generating DDL so that the appropriate code can be created automatically.  This logic is very tightly integrated with PowerDesigner's Database and Object Language Definition Files, which also enables you to easily transport this functionality to all of your designers.  Currently you can only associate extended attributes with objects in Physical or Object models, PowerDesigner 8.0 will extend this this functionality to Conceptual models and also add the ability to create extended attributes for Physical and Object models which are not dependent on the target database or target source language.

PowerDesigner 7.5 support for Extended Attributes is contained in the Database Definition or the Object Language Definition.  The instructions provided below will discuss making changes to a Database Definition file, but most instructions will also apply to Object Language definitions.  In every definition file there can be an Extended Attributes section.  This section will contain Types and Objects.

Types are used for restricting what is allowed for entry into an Extended Attribute.  When Types are created they are assigned a name, comment and a list of allowed values.  Types are used by Extended Attributes by assigning them as the attributes Data Type.

Objects are the container to hold your extended attributes.  As you require extended attributes they are added to the appropriate objects within this section of the definition file.  In most cases this subfolder will be empty, and desired objects are added to them as needed.

How to implement extended attributes

Object Creation

First we need to get to the desired Database or Object Language Definition.  To access this capability:
Select Tools > Resources > DBMS or Object Languages.

Step 1:  Create a copy of the target you would like to change, just in case.  In most cases you want to extend the behavior of one of the supplied target databases.


Step 2:  Define Extended Attributes.



Types  are used for restricting values entered in an Extended Attribute to a fixed list.  In the following example there is a requirement to categorize each table into a predefined list of categories.  To accomplish this an Extended Attribute Type was created to specify my predefined list, then an Extended Attribute was created for a Table.  To create a Type:

Step 1: Create the type

The following screen shows the completed Extended Attribute Type definition

The following screen shows the completed Extended Attribute definition.  Notice that my Extended Attibute Type is now in my list of valid Data Types.

The following screen shows the Extended Attibute in use on the table Employee.  Notice that entry is restricted to the list of valid categories.


Accessing Extended Attributes

Now that we have defined extended attributes and types, what can be done with them.  As has already been shown, the values are maintained on the Extended Attributes tab of the property sheet for each object.  These values can be included on reports, via the extended attributes list item within every object in the Report Editor.  These values can affect the generation of script by incorporating these variables into your Create or Add syntax, also maintained in the DBMS Definition files.  If values for the extended attributes are contained in your DBMS, they can be reverse engineered via ODBC by modifying the SqlListQuery, SqlAttrQuery or SqlOptQuery, also maintained in the DBMS Definition files.  Reverse engineering via script files will occur because of the generation changes.  These values will always be accessed by using the %ExtendedAttributeName% format in the definition files.  Extended Attributes can be used as User Defined variables within the context of the object it is assigned to.  Documentation can be found in the Using the DBMS Definition File Reference Guide chapter in the Advanced User Documentation manual on how PowerDesigner uses variables.   Also reference the examples listed below for specific examples of how this is done.



Back to Top
© Copyright 2010, Sybase Inc.