You are on page 1of 32

-“fr

TF1‘

1- Jr
F-|.
L _l'
".' "-
r -fix _l._ _ i

' “'1':

___...-nIII=!-'I"['*'*"“"' /1% M 1-
|"
--ll-.. __-rl

I11

-|. I ..- |"|J.-_Hl I

'\_

% ,_ ""-=»
_
--
L ' __
._'_
' —____ -- -
-__|__- _
- "*" IL;4'j I . __-__
“"‘
.
.._* -—= ~11
_-—\_ _____ I: ll .
‘I . _ -‘I * 1' 1- - .

--;_-;
_%_ _ . _ -_
H
I -I-F .
L '|. _

--I.
.,,|" _

' --u||.,_._._
T-‘E
1. '1].
‘H. _.H
'
..-l-"

__
PowerDesigner Options
DBMS Definition File (XDB)
Definition Files (XDB and XEM)
Generation Template Language (GTL)
VB Script
PowerDesigner Metamodel
Miscellaneous Tips

geunwave
fillli

EITF-11$ l- 5|l.|.|T!I$ EEIIEIEIIIE


.___
-.-
i_ ._. H

What
- Method for controlling F’owerDesigner behavior.
- Display Preferences - controls visual aspects of PowerDesigner
~ Model Options - controls model specific aspects of PowerDesigner
- General Options - options not specific to any particular model
Why
- Alter PowerDesigner behavior to best suit your needs
- Changes can either be model specific or set as defaults for new models
created
How
- General Features Guide - Chapter 3 - Using the F’owerDesigner Interface ~—~
Defining Global Options
- General Features Guide — Chapter 7 - Managing Models — sections dealing
with Naming Conventions and Conversion
- General Features Guide - Chapter 14 - Model Graphics - Model Display
Preferences

Ililihwflllfla
IIIIIE

EIITIU-|H'E l- 5il|JTII5 IIUIEIZEIIIE


I" _
I

—r

General - General display preferences


- Windows background, Unit, Grid, Diagram
Object View
- Top level controls name splitting of text in all graphics - options for none,
truncation or word wrapping
- Display options for each type of base object -~ options vary by object
Format
- Control of actual graphic symbol - size, line styles, fill, shadow, font, and
custom shape
- Text cannot be embedded within custom shapes

reunwavrs
ITIHE

EITF-11$ l- 5|l.|.|T!I$ EEIIEIEIIIE


.___
-I -
i. --- —-I-I'.h-I—|I--I-

6 fin
... iI—-I--i

Model level - List of PDM objects that can have options set
- NameiC-ode case sensitivity - applies to all objects in the model
TIP: Select Name/Code Sensitivity option to ignore the case during
comparison, generation, or merging of models
- Ignore Identifying Owner - applies to tables, views, and stored procedures
- Column 8t Domain -
- Enforce non-divergence — this option determines if column properties
must be the same as those of the domain or if they can differ
- Column properties that can be set are Data type, Check, Ftules,
Mandatory, and Profile
- Default data type - the data type that applies to columns and domains if
no data type is selected

jeinwavre
I'll‘-IIE

EITIU-|H'E l- 5Il|1TriW5 IIIIIEIZEIIIE


"'.l'+I'\|l'l| i

Model level (cont)


- Reference - Flules when creating references
- Unique code - forces each reference to have a unique code
- Auto-reuse columns - attempts to reuse an existing column in the child
table as the foreign key
- Auto-migrate columns - migrates the primary key as a foreign key and will
optionally migrate the domain, checks and rules associated with the PK
- Default Link on creation - determines if a join will be created by default for
the reference
- Default implementation - indicates how referential integrity is implemented
in the reference, either declarative or triggers

jeinwavs
ITIIII

EITII-I-IKE l- 5ll|JTII5 IIEIIEIEIIIE


""_ .-1-'_ _
---- 111

.|
\-‘I

II

elm

Naming Conventions - Set rules to enforce predefined name


and code formats for all objects
- Display - set to display either name or code values for the model
- Enable nameicode conversion - enables or disables the use of conversion
scripts and conversion tables to generate a code from a name or a name from
a code
- Name 31 Code - specify the format for constraints on length, character case
and valid characters for objects
- Naming Template — specify a format template for use with several types of
objects within a model
- Name to Code 31 Code to Name — uses a combination of a conversion script
andior a conversion table to generate an objects name from its code or an
objects code from its name

I'll-lli

TBBIIWBIIBs
I'-.1

|.l5EliI Ill-Illll-E I. 5lI|.|.|TII'||5 EIIEEIZEHJIE


,
' '; Ii-ti _ _ .- _ __ _

__l
1 - . .
_-Ii I'-

General - general default settings


- Delete, Browser, Drag & Drop, Output log, Graphical tool behavior
Dialogue - define Property sheet behavior
Tip Enable Name to Code mirroring option if using conversion scripts
Editors - specify specific editors for different file types
Variables — list of “environment” variables used by
PowerDesigner
Named Paths — logical paths used when paths are saved
within files
Fonts — default font settings and naming conventions based
upon the language version of Windows installed on your
machine
- User interface (lists), Code editor (SOL preview), HTF editor (description,
annotation) can be modified
Repository - general repository interaction default settings
ITIIIE
El
El

l.l5EF. lH.llli'-ffE- -!. 5E=L|.|T ‘EH5 EIIIHFEIFJIEE


I--J‘ '-,1,-__' I
-It
III‘

I -1

Inter model
- Convert Names into Codes option must be selected during inter model
generation
- Object codes are generated from names using associated conversion
script
DBCreateAfter Stereotype
- Used with stored procedures and views to control generation order

llllillwflllltfi
IFEEITF-ll l- EIIITE EIIIHIE
"i
""_ Ir. _' ii ___, ,
_
-| i

.1.
b

Ii---—_|_

__l ‘
_
fril-
q
i

Reverse engineer into an existing model or a new model


Selection — specify DBMS source to be reverse engineered.
Either an ODBC data source or SOL script file
- reverse using administrators permission - select in order to be able to select
data in the system tables that are reserved to a database admin
Options
- After reverse engineering - options that potentially can alter the reverse
engineered results
- Script terminator - terminator used to end the statement when reverse
engineering via script
Target Model - includes or allows you to add target model(s)
to create external shortcuts

ITHIE
PI-1'

r.-.1
user lllil.llll-till-3l.5El.l.lT-lJllSlIl]lI=EI:Elll'IE
_-l-_
IIKI Ii.-Iii :

Problem:
- When the auto-layout feature is executed, synonyms are sometimes created
for several object. This functionality is not always desired especially when
reverse engineering a database.
Solution:
- Use the following registry key to deactivate the synonym creation
- [HI<EY_CURRENT_USERRSoftwaretSybaselPowerDesigner 9‘tGeneral]
- “SynonymslnAutoLayout"= "No" ("Yes" by default)

jecliwaves
Elli-I-|'~§ l- 5I.|.lTlI$ IIIIIEIIIIIIE
—,-_
%——'l|.|-1-1-“; *—-I

‘fr
I Ill

What
- Method used by PowerDesigner that contains specifications for a particular
Database Management System (DBMS). It contains the syntax templates for
generation, reverse engineering, data types and constants for a supported
DBMS.
Why
- Used by PowerDesigner engineering to support all the DBMS
- Used by users to alter standard DBMS to better suit their needs
- Used by users to add new DBMS that are not shipped with PowerDesigner
How
- Advanced User Documentation -- Chapter 1 —~ DBMS Reference Guide
- Advanced User Documentation -- Chapter 2 —- Managing Profiles
- Physical Data Model User's Guide - Chapter 13 - Variables in PowerDesigner
- Physical Data Model User‘s Guide - Chapter 14 - DBMS-Specific Features
- Fteview included XDB files for understanding and ideas

Ifllli

Tlilthwfllltta
IISEETIJIIHE I. 5ll.|.|T‘II'I5 E|]IEIfli=E
“ .-1|-"_ ,_
- 1- |-ti-'_' _i _

‘It
1?-—@ 'i _ i
II.-

Ki
i- | ii‘ 1-1- -*-
-?_
__i _-HIE:-.1

General - DBMS Identification and general flags that apply for


all objects
Script - DBMS characteristics, command definition, and data
type translations for script generation and reverse
engineering
- SOL — contains values that define the general syntax for the database
-- Syntax - Contains general parameters for SOL syntax
- Format - Contains entries that define script formatting
-- File - Text entries used during the database generation
- Keywords - List of reserved words and functions available in SOL
- Objects - details for each type of object available for generation to and
reverse engineering from the database

I'll!!!
I'-.1

Tlilillwflllli§
USER Tlllllllf-E I. SEHIITIIHS IIIIEEIZEHEE
.___
.-i-" -
i. --- —-I-I'.h-I—|I--I-
M -jl

Script (cont)
- DataType -~ lists of valid data types including conversions to PowerDesigner
internal data types
- AmcdDataType — list of PowerDesigner internal data types mapped to
DBMS data types
- OdbcPhysDataType - translation table from ODBC data types to target
DBMS data types
- PhysDataType -- contains the translation table from target database data
types to internal data types
- PhysDttpSize - table of storage sizes of target DBMS data type
- PhysOdbcDataType — contains data type translations from target DBMS
to ODBC
- HostDataType - translation from database data type to procedure data
type
- Abstract translation files — several files for abstraction data type
translation
- Customize - retrieved information from PowerDesigner 6 DEF files
I'll‘-IIE

jeinwavre
EITIU-|H'E l- 5ll|1TriW5 IIIIIEIZEIIIE
.- .|._ I _' _ I Ll‘. 5 ii iii
| I I '-- -.-I rl _. _ _
ii I i h | - _ _

__I
_ I. 1‘ I

ODBC - same structure as Script category. Used for ODBC


generation when DBMS Script category does not suffice
Profile - see next section
Trigger templates - list of pre-defined trigger templates
indicating referential integrity
- Trigger type - insert, update, delete
Trigger template items - list of pre-defined trigger template
items to support the PowerDesigner trigger templates

I'll-ll!

jggwave SELUT' BBBBB EEIIEH


.1_- L I .
-- -
' ""_
- If -fi;_FT'—
_.-1-' Z

‘F :|.(_ --I I I _ -' . . __________ I - -,_.-'- .*l-'l-


' ' r - | _ .
1 . -I =-_ __- ’ " ‘ --- -

_ ¥
‘_ ' 44- I I I I-I ' . _ _ I I

__I
- —.l. ' '_ ."._ ' _-
—__. I ._—_ ' I.

Generation - object statements are parsed and their variables


are evaluated and replaced. Script and ODBC use the same
StfltBl'l1Bl'1tS
- Extension mechanism - uses extension statements to generate additional
code before or after the Create, Drop, or Modify statements
- Defined using PowerDesigner Generation Template Language (GTL)
- Can contain references to extended attributes, variables, and macros
Modify statements - statements used to modify existing
objects during database modification and to generate DDL
outside the ‘table’ create statement
- ModifiableAttributes - list of extended attributes to be evaluated during the
Modify database process
Database definition items
- Statements that customize the PowerDesigner interface and behavior
according the current database features

ITIIIE

USEFII I'l.llll.-'1 I. SELUT EIHS EUHFEFJIEE


i

1.11- ' ' ‘I - '1 |- |-I Jill. .1 3.1 J .- -


?i- -‘IS’ "
'- '1' .1 . I. . J__|| I I H
in -1 I H_ -I‘
'-'-vI"'- E --I '-'_"l"1|-'I.I"I.-.-31:‘-.-.-||,i|:|!-:-Ii

__j

Reverse engineering
- Script - Each statement in the script file maps to a create statement in the
DBMS file
- ReversedStatements — list of Extension statements used in database
generation
- ODBC - two distinct type of queries are used to retrieve information from
system tables when the default ODBC function calls do not retrieve enough
information
- Extended Queries - user defined queries and variables used when
system table information is stored in Long, Blob, or Text columns
- Returned field allowing this is indicated in query header with the "EX"
indicator
- When the "E>(“ is found, and if the returned value contains a °.-ii“/it
with query name and field name, then it will execute the appropriate
query and use the returned value to replace the %% part.
- ReversedOueries - list of usersdefined ODBC queries to be taken into
account via reverse engineering
- Queries must be listed in ReveredOueries item to be executed
- The result of a query is mapped to PowerDesigner internal variables via
the query header IUIIIE
l'-.1
TBIFUWUUES
user rrurnss t smurous |Il]EEI:ElllIE
I" _
I

Problem:
- When executing Modify Database, PowerDesigner generates the DDL based
upon statement type. All the drop statements, then the create statements, etc.
However, some customers do not like this format.
Solution:
- Change the modify SOL order. To group all the SOL orders relative to a table
in Modify script add the following registry key (CR 270997)
- [HKEY_CURRENT_USER‘rSoftware‘\Sybase‘tPowerDesigner
9‘rFolderOptions‘rPhysical Objects]
— "GenTablGroupStmt" = "Yes"

jeclrwaves
fill!!!

EITII-11$ l- 5|l.|.|T!I$ IIEIIEIEIIIE


.___
-I -
i. --- —-I-I'.h-I—|I--I-

_.£
What
- Mechanism for extending PowerDesigner object definitions
- Contains graphical, functional and generation parameters
Why
- Used by PowerDesigner engineering to support various functions
- Can be used to complement object language generation - Application servers
suppon
- Can be used to generate totally new text files
- Users can customize included behavior to better suit your requirements
- Users can add totally new functionality
How
- General Features Guide — Chapter 8 -- Working with Extended Model
Definitions
- Advanced User Documentation - Chapter 2 — Using Profiles
- Advanced User Documentation — Chapter 4 - Extended Model Definitions
Reference Guide
- Review included XEM files for understanding and ideas

jeinwavre
I'l'lllIE

EITIU-|H'E l- SIIUTIIWS IIIIIEIZEIIIE


-l_ —-_-

Extended Model Definition properties


- Name and Code - uniquely identify this definition
- File Name ~ where XEM is saved, blank if internal to the model
- Family - Classify an XEM, usually to associate it with an Object Language
- Sub Family - further classification of and XEM within the selected family
- Auto attach - determines whether the default is to include this XEM in new
models created targeting the family specified above
- Category - used to control generation options
- Enable Trace Mode - debugging./learning tool that lets you preview the
templates used
- Complement Language generation - determines whether this XEM definition
will be used in the language generation (Only available for OOM XEM files)

I'l'llIE
l"r.'I

Eflliflwflllfls
|.lSEliITl.l.l|'I'E I. SSIEUTLIIUS SUIEIZEISE
Generation section — define optional tasks to be processed
after generation and options used during generation
- Commands - actual commands which will be executed post generation
- Options - options user can specify as part of the generation process
- Tasks — actual list presented during generation, these reference one or ITIDTB
commands defined above
Profile - see next section

jeclrwaves
ITIIIE

EITF-I-|H'S l- SIIUIIIS SUIEIZEISE


.___
-I -
i. --- —-I-I'.h-I—|I--I-
P1111

_.£
Problem:
- PowerDesigner implicitly cut pages every 50 rows for list which can be a
problem for large model
Solution:
- Define when you want PowerDesigner to generate a page break in list using
the following keys:
- NbRowlnHtmlList - allows to define the number of items you want on each
HTML pages generated for list items
- NbSubPagelnHtmlList - allows to define the number of links you want to
have below each pages of the list.
- [HKEY_CURRENT_USER‘rSoftware\.Sybase\PowerDesigner 9\General]
- "NbRowlnHtmlList" = "50" (default value)
- "NbSubPageInHtmlList" = "20" (default value)

jeinwavre
I'l'lllIE

El‘-lilil-|H'E l- SIIUTIIWS SUIEIZEISE


What
- Extension mechanism for customizing the PowerDesigner Metamodel
- Categorizing objects, customizing graphics, adding metadata, adding object
specific generation options and more
Why
- Used by PowerDesigner engineering in both XDB and XEM files
- Allows customizing graphics based on object type and category
- Customize context menus based on object type
- Add additional metadata to specific object or categories of objects
How
- Advanced User Documentation -- Chapter 2 - Managing Profiles
- Review supplied XDB and XEM files for examples of usage

jrrclrwaves
ITIIIE

EITII-I-IFS l- SIIUTIIS SUIEIEISE


|
' '__ .-1-"__ _
- --- -III

I‘-ll‘:-|.|.|-' .. .

Shared - contains extended attribute types or templates


which can be used by any object
Metaclass level extensions
- Determines the level at which the extension applies
- Extensions apply to all instances of the metaclass
- The PowerDesigner metamodel is object oriented and thus supports
inheritance
Tip - when adding metaciasses, change the filter to show abstract classes
- Example — extended attributes applied to the following levels would
apply to
=-=- NamedObject - applies to all objects
=-=- ConstrainedNamedObject - applies to Columns and Domains
=-=- Columns — applies to Columns only

IIIIIE
I'-.1

IEIEIIWUUBS
USERTIIIIHE I. SSl.UT:iSI'IS SUIEIIIESE
..-l-"

iriii

lnstance level extensions


- Stereotype — extension applies to instances of the object which have had the
stereotype set to match
- In 9.5.x, primarily used in the PowerDesigner OOM.
- In PowerDesigner 10 stereotypes can be used in the PDM as well
- Example Java Classes — E.JBEntity, EJBSession, WebAppListener
- Criterion — extension applies to instances of the object which match the
Criterion's condition
- Conditions are defined using expressions from the .if macro syntax of
PowerDesigner's GTL

jeclrwaves
ITIIIE

EITII-11$ l- 5|l.|.|T!I$ SUIEIEISE


|
' '__ .-1-"__ _
- --- -III

I‘-ll‘:-|.|.|-' .. .

For any of the levels listed above the following extensions can be added
- Extended Attributes — additional metadata which can be controlled by each
instance and used to control generation
- Custom Checks — enhance the validation of instances when check model is
performed
- Includes check and auto-fix logic
-r Written in ‘v'BScript
- Custom Symbol - customize the visual display of objects to better identify the
instances
- Custom Tool (Stereotypes only) — allows the creation of a tool palette object to
ease the creation of objects
- Templates and Generated files - used to generate text files based on the
model
- Tip - F12 to find where a template is defined
- Method and Menu - These two are used to add entries to context menus.
Method hold the VBScript to execute. Menu is the text that shows in the menu

I'll-\IE

Tliltllwfllltia
I'-.1

USEliI‘.|'l.l.ll'lI'E I. SSIr.UT:iSI'IS SUIEIEIISE


.-if

_—
What
- PowerDesigner internal template based language used for text generation
- Used in Definition files (XDB or XEM) to generate files based on a model
Why
- Allows for all PowerDesigner generation to be flexible
- Used by PowerDesigner engineering to generate text files
- Can be used by users to alter files generated by PowerDesigner to suit your
individual needs
- Can be used to generate entirely new files.
How
- Review supplied database definitions and extended model definitions
- Advanced User Documentation - Chapter 5 — Generation Reference Guide

jeclrwaves
ITIIIE

EITFII-Ii l- 5|l|.|TIIS SUIEIEISE


I
III Ii.-I--iii

_—
What
- Microsoft scripting language
Why
- Automate repetitive tasks
- Import i Export information
- Extend PowerDesigner via additional model checks
- Access PowerDesigner information from other applications
- Used by PowerDesigner engineering to implement certain functionality
How
- Review supplied sample scripts
- PowerDesigner home directory\VBScripts
- PowerDesigner home directory‘tOLE Automation
- Get familiar with the PowerDesigner Metamodel
- Experiment - *Backup your models first*

trvrrrwave
EITII-I-I1 l- 5I.l.|TlI$ SUIEIIIISE
..-l-"

4-vb 1. T‘

What
- A description of PowerDesigner objects, properties and methods
Why
- Learn how to access PowerDesigner objects
- Using VBScript
- Using Generation Template Language
- Using other languages that support COM
- Understand PowerDesigner XML formatted models
How
- PowerDesigner home directory\ExampleslMetamodel.oom
- Set of UML class diagrams graphically representing the metamodel
- PowerDesigner home directory‘tpdvbs9.chm
- Hyperlinked reference document of the PowerDesigner Metamodel

iiirrwave
|.iSEiETlilil.l'§ I. 5|l.UT!IS SUIEIIISE
'-'_ _.
- --I-3 :1‘. -_

_-.-,_-,|,-I, ,,_;|- _ _
-I-I HF r-I II-l..|..|u-
---:
I. I Fm‘
i -'_ .
'=""'—"-'-‘- 1' .
—— I
'-Tqrfi

_ A New Benefit for Sybase Developers

Forum for exchanging samples, tools, scripts, etc


New features enable community collaboration
- Download samples created by Sybase or external users
- Leverage contributions of others to extend Sybase products
- Contribute code or start your own collaborative i open source project with input
from other product experts
Any SDN member can participate
- Log in using your MySybase account via SDN
www.codexchange.sybase.com
- Or via SDN at www.sybase.comidevelo|ger
SDN & CodeXchange at TechWave
- ‘visit SDN in the Technology Boardwalk
- Learn about CodeXchange in the Sybase Booth Theater

IIIIIE
I'-.1

IBIEIIWUUBS
USER IIIIIWI-E I. SEI.UT:Il'HS SUIEREHSE
-.-
__--.|.-—.-—- in

__
QUESTIONS an
'"~. I ,1
""--.

‘III...-

-‘II go‘

jeclrwaves
ERTF-11$ l- 5|l.l.|T!I$ SUIEIEISE
-“it
aw,‘

1- Jr
F-|.
L _l'
".' "-
r -fix _l._ _ i

' “'1':

___....-nIII=!FIf'*"""" .£_- M 1-
r"
--ll-.. _-rl

I11

-|. I ..- r"|J.-_Hl I

'l_

- ,_ ""-v
_
--
tr. ' __
._'_
' —____ -- -
-__|__- _
- "f" IL;4'j I . __-__
“"‘
.
.._* -—=~~~s~
_-—r_ _____ I: ll .
‘I . _ -‘I * 1' 1- - .

c-ea;-;
_%_ _ . _ -_
‘S
I -I-F .
L '|. _

--I.
.,.i' _

' --u||._._._
T-‘E
1. '1].
ir. _.,!
'

You might also like