power-designer object oriented modeling
TRANSCRIPT
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
1/688
Object-Oriented Modeling
PowerDesigner ® 16.1
Windows
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
2/688
DOCUMENT ID: DC38086-01-1610-01
LAST REVISED: November 2011
Copyright © 2011 by Sybase, Inc. All rights reserved.
This publication pertains to Sybase software and to any subsequent release until otherwise indicated in new editions or
technical notes. Information in this document is subject to change without notice. The software described herein is furnishedunder a license agreement, and it may be used or copied only in accordance with the terms of that agreement.
Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced,
transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior
written permission of Sybase, Inc.
Sybase trademarks can be viewed at the Sybase trademarks page at http://www.sybase.com/detail?id=1011207 . Sybase and
the marks listed are trademarks of Sybase, Inc. A ® indicates registration in the United States of America.
SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP AG in Germany and in several other countries all over the world.
Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other
countries.
Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.
All other company and product names used herein may be trademarks or registered trademarks of the respective companies
with which they are associated.Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS
52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.
Sybase, Inc., One Sybase Drive, Dublin, CA 94568
http://www.sybase.com/detail?id=1011207
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
3/688
Contents
PART I: Building OOMs ..................................................1
CHAPTER 1: Getting Started with Object-OrientedModeling.......................................................................3
Creating an OOM ...................................................................5
OOM Properties ..............................................................7
Previewing Object Code ........................................................8
Customizing Object Creation Scripts ................................10
Customizing your Modeling Environment .........................11
Setting OOM Model Options .........................................11
Setting OOM Display Preferences ................................13
Viewing and Editing the Object Language Definition
File ............................................................................13
Changing the Object Language ..........................13
Extending your Modeling Environment .........................14
Linking Objects with Traceability Links .........................15
CHAPTER 2: Use Case Diagrams................................17
Use Case Diagram Objects .................................................18
Use Cases (OOM) .................................................................18
Creating a Use Case....................................................19
Use Case Properties ....................................................19
Actors (OOM) .......................................................................20
Creating an Actor ..........................................................22Actor Properties ............................................................22
Reusing Actors .............................................................24
Use Case Associations (OOM) ...........................................24
Creating a Use Case Association .................................25
Use Case Association Properties .................................25
Object-Oriented Modeling iii
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
4/688
CHAPTER 3: Structural Diagrams...............................27
Class Diagrams....................................................................27
Class Diagram Objects .................................................28Composite Structure Diagrams..........................................29
Composite Structure Diagram Objects .........................30
Package Diagrams ...............................................................31
Package Diagram Objects ............................................32
Object Diagrams..................................................................32
Object Diagram Objects ................................................33
Classes (OOM) .....................................................................34
Creating a Class ...........................................................34
Class Properties ...........................................................35Creating Java BeanInfo Classes ...................................39
Creating a Java BeanInfo Class from the
Language Menu..............................................41
Creating a Java BeanInfo Class from the Class
Contextual Menu.............................................42
Generic Types and Methods .........................................42
Creating Generic Types .......................................42
Creating Generic Methods ...................................43Creating a Specialized Classifier .........................43
Creating a Bound Classifier .................................45
Generic Type Example .........................................45
Composite and Inner Classifiers ...................................46
Creating Inner Classifiers ....................................46
Creating a Composite Classifier Diagram ............47
Specifying a Classifier as a Data Type or Return Type
..................................................................................47
Viewing the Migrated Attributes of a Class ...................48
Packages (OOM) ..................................................................49
OOM Package Properties .............................................50
Defining the Diagram Type of a New Package ..............51
Interfaces (OOM) ..................................................................51
Contents
iv PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
5/688
Creating an Interface....................................................51
Interface Properties ...................................................... 52
Objects (OOM) ......................................................................54
Creating an Object ........................................................56
Object Properties ..........................................................56Linking a Classifier to an Object ...................................57
Parts (OOM) ..........................................................................58
Creating a Part ..............................................................59
Part Properties ..............................................................59
Ports (OOM) ..........................................................................60
Creating a Port ..............................................................61
Port Properties ..............................................................61
Redefining Parent Ports ................................................63
Attributes (OOM)..................................................................63
Creating an Attribute .....................................................64
Copying an Attribute to a Class, Interface, or
Identifier ...........................................................65
Overriding an Attribute in PowerBuilder ...............66
Adding Getter and Setter Operations to a
Classifier ..........................................................66
Attribute Properties .......................................................67
Setting Data Profiling Constraints .................................70Creating Data Formats For Reuse.......................71
Specifying Advanced Constraints ........................72
Identifiers (OOM) ..................................................................72
Creating an Identifier .................................................... 73
Creating a primary identifier when you create the
class attributes ................................................ 73
Defining the Primary Identifier from the List of
Identifiers .........................................................74Identifier Properties ...................................................... 74
Adding Attributes to an Identifier ...................................75
Operations (OOM) ................................................................76
Creating an Operation .................................................. 76
Copying an Operation From Another Classifier . . .77
Contents
Object-Oriented Modeling v
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
6/688
Inheriting and Overriding Operations from
Parent Classifiers ............................................ 77
Creating a Standard Operation ............................77
Implementing Operations from an Interface .........78
Operation Properties ....................................................79Parameters (OOM).......................................................83
Associations (OOM) ............................................................84
Creating an Association ................................................86
Association Properties ..................................................86
Association Implementation ..........................................89
Understanding the Generated Code ....................91
Creating an Association Class ......................................92
Migrating Association Roles in a Class Diagram..........93
Migrating Navigable Roles ...................................93
Rebuilding Data Type Links ..........................................94
Linking an Association to an Instance Link ...................94
Generalizations (OOM) ........................................................95
Creating a Generalization .............................................96
Generalization Properties .............................................96
Dependencies (OOM) ..........................................................98
Creating a Dependency ................................................99
Dependency Properties ..............................................100Realizations (OOM) ............................................................102
Creating a Realization ................................................102
Realization Properties................................................103
Require Links (OOM) .........................................................103
Creating a Require Link ..............................................104
Require Link Properties ..............................................104
Assembly Connectors (OOM) ...........................................105
Creating an Assembly Connector ...............................105Assembly Connector Properties .................................106
Delegation Connectors (OOM) .........................................106
Creating a Delegation Connector ...............................107
Delegation Connector Properties ...............................107
Annotations (OOM) ............................................................108
Contents
vi PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
7/688
Attaching an Annotation to a Model Object ................108
Creating a New Annotation Type ................................110
Using the Annotation Editor ........................................113
Instance Links (OOM) ........................................................113
Creating an Instance Link ...........................................116Instance Link Properties ............................................. 117
Domains (OOM) ..................................................................117
Creating a Domain ......................................................118
Domain Properties ......................................................118
Updating Attributes Using a Domain in an OOM........121
CHAPTER 4: Dynamic Diagrams ...............................123
Communication Diagrams................................................123Communication Diagram Objects ...............................125
Sequence Diagrams ..........................................................125
Sequence Diagram Objects ........................................128
Activity Diagrams ..............................................................129
Activity Diagram Objects .............................................131
Statechart Diagrams ..........................................................131
Defining a Default Classifier in a Statechart Diagram
................................................................................133Statechart Diagram Objects .......................................133
Interaction Overview Diagrams........................................134
Interaction Overview Diagram Objects .......................135
Messages (OOM) ................................................................135
Creating a Message ....................................................137
Message Properties ....................................................137
Creating Create and Destroy Messages in a
Sequence Diagram.................................................141
Creating Create Messages ................................141
Creating Destroy Messages ..............................142
Creating a Recursive Message in a Sequence
Diagram ..................................................................143
Contents
Object-Oriented Modeling vii
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
8/688
Creating a Recursive Message Without
Activation .......................................................144
Creating a Recursive Message with Activation
.......................................................................145
Messages and Gates ..................................................145Sequence Numbers ....................................................147
Moving Sequence Numbers ..............................147
Inserting Sequence Numbers ............................149
Increasing Sequence Numbers in a
Communication Diagram...............................149
Decreasing Sequence Numbers in a
Communication Diagram...............................149
Activations (OOM) .............................................................149
Creating an Activation .................................................150
Creating Activations with Procedure Call
Messages ......................................................150
Creating an Activation from a Diagram..............150
Attaching a Message to an Activation .........................150
Detaching a Message from an Activation ...................151
Overlapping Activations ..............................................151
Moving an Activation ...................................................152
Resizing an Activation................................................152Interaction References and Interaction Activities (OOM)
.........................................................................................153
Creating an Interaction Reference ..............................153
Creating an Interaction Activity ...................................154
Interaction Reference and Interaction Activity
Properties ...............................................................154
Manipulating Interaction References ..........................154
Interaction Fragments (OOM) ...........................................155Creating an Interaction Fragment ...............................155
Interaction Fragment Properties .................................155
Manipulating Interaction Fragments ............................157
Activities (OOM) .................................................................158
Creating an Activity .....................................................159
Contents
viii PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
9/688
Activity Properties .......................................................160
Specifying Activity Parameters ...................................162
Specifying Action Types ..............................................163
Example: Using the Call Action Type .................164
Example: Reading and Writing Variables ..........167Decomposed Activities and Sub-Activities ..................168
Converting an Activity Diagram to a
Decomposed Activity .....................................170
Organization Units (OOM ) ................................................171
Creating an Organization Unit ....................................171
Creating Organization Units with the Swimlane
Tool ................................................................172
Organization Unit Properties ......................................172
Attaching Activities to Organization Units ...................173
Displaying a Committee Activity ................................173
Managing Swimlanes and Pools .................................174
Moving, Copying and Pasting Swimlanes..........175
Grouping and Ungrouping Swimlanes ...............176
Creating Links Between Pools of Swimlanes .....178
Changing the Orientation of Swimlanes ............178
Resizing Swimlanes ...........................................179
Changing the Format of a Swimlane.................179Starts ( OOM).....................................................................179
Creating a Start ..........................................................180
Start Properties ..........................................................180
Ends ( OOM) .......................................................................180
Creating an End ..........................................................181
End Properties ............................................................181
Decisions ( OOM) ...............................................................182
Creating a Decision ....................................................184Decision Properties ....................................................184
Synchronizations ( OOM) ..................................................185
Creating a Synchronization .........................................186
Synchronization Properties .........................................186
Flows ( OOM) ......................................................................187
Contents
Object-Oriented Modeling ix
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
10/688
Creating a Flow ...........................................................188
Flow Properties ...........................................................188
Object Nodes (OOM) ..........................................................189
Creating an Object Node ............................................190
Object Node Properties ..............................................190States (OOM)......................................................................191
Creating a State ..........................................................192
State Properties ..........................................................192
Decomposed States and Sub-states ..........................194
Converting a Statechart Diagram to a
Decomposed State ........................................196
Transitions (OOM) ..............................................................197
Creating a Transition ...................................................197
Transition Properties ...................................................198
Events (OOM) .....................................................................199
Creating an Event .......................................................200
Event Properties .........................................................200
Defining Event Arguments ..........................................201
Actions (OOM) ....................................................................201
Creating an Action ......................................................203
Action Properties ........................................................203
Junction Points (OOM) ......................................................204Creating a Junction Point ............................................205
Junction Point Properties ............................................205
CHAPTER 5: Implementation Diagrams....................207
Component Diagrams.......................................................207
Component Diagram Objects .....................................208
Deployment Diagrams.......................................................209
Deployment Diagram Objects .....................................210
Components (OOM) ...........................................................210
Creating a Component ................................................211
Using the Standard Component Wizard ............211
Component Properties ................................................212
Contents
x PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
11/688
Creating a Class Diagram for a Component ...............215
Deploying a Component to a Node.............................216
Nodes (OOM) ......................................................................216
Creating a Node ..........................................................217
Node Properties ..........................................................217Node Diagrams ...........................................................218
Component Instances (OOM) ...........................................218
Creating a Component Instance .................................219
Component Instance Properties .................................220
Files (OOM) .........................................................................220
Creating a File Object .................................................221
File Object Properties .................................................222
Node Associations (OOM) ................................................223
Creating a Node Association ......................................223
Node Association Properties ......................................223
CHAPTER 6: Web Services ........................................225
Defining Web Services Tools ............................................225
Defining Web Services Targets ........................................228
Defining Web Service Components .................................228
Web Service Component Properties ..........................228Creating a Web Service with the Wizard ....................231
Creating a Web Service from the Component Diagram
................................................................................233
Defining Data Types for WSDL...................................234
WSDL Data Type Mappings ...............................234
Selecting WSDL Data Types ..............................234
Declaring Data Types in the WSDL...................234
Web Service Implementation Class Properties ..........234
Managing Web Service Methods ......................................235
Creating a Web Service Method .................................235
Web Service Method Properties .................................237
Implementing a Web Service Method in Java .............237
Defining the Return Type of an Operation.........237
Contents
Object-Oriented Modeling xi
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
12/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
13/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
14/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
15/688
Importing Rational Rose Deployment Diagrams ............326
CHAPTER 11: Importing and Exporting an OOM inXMI Format ...............................................................327
Importing XMI Files ...........................................................327
Exporting XMI Files ...........................................................327
PART III: Object Language Definition Reference......329
CHAPTER 12: Working with Java..............................331
Java Public Classes ..........................................................331
Java Enumerated Types (Enums) .....................................331JavaDoc Comments ..........................................................334
Defining Values for Javadoc Tags ...............................337
Javadoc Comments Generation and Reverse
Engineering ............................................................ 339
Java 5.0 Annotations .........................................................339
Java Strictfp Keyword .......................................................340
Enterprise Java Beans (EJBs) V2 ....................................341
Using EJB Types .........................................................342EJB Properties ............................................................343
Creating an EJB with the Wizard ................................344
Defining Interfaces and Classes for EJBs ...................347
Defining Operations for EJBs ..................................... 349
Adding an Operation to the Bean Class ............ 350
Adding an Operation to an EJB Interface ..........350
Understanding Operation Synchronization ........351
Understanding EJB Support in an OOM .....................351
Previewing the EJB Deployment Descriptor ............... 354
Generating EJBs .........................................................356
What Kind of Generation to Use? ......................357
Understanding EJB Source and Persistence .....359
Contents
Object-Oriented Modeling xv
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
16/688
Generating EJB Source Code and the
Deployment Descriptor ..................................360
Generating JARs ........................................................361
Reverse Engineering EJB Components .....................362
Enterprise Java Beans (EJBs) V3 ....................................363Creating an EJB 3.0 with the Enterprise JavaBean
Wizard ....................................................................363
EJB 3.0 BeanClass Properties ...................................367
EJB 3.0 Component Properties ..................................368
Adding Further Interfaces and Classes to the
EJB ................................................................368
EJB 3.0 Operation Properties .....................................369
Java Servlets ......................................................................370
Servlet Page of the Component ..................................370
Defining Servlet Classes ............................................371
Creating a Servlet with the Wizard .............................371
Understanding Servlet Initialization and
Synchronization ......................................................372
Generating Servlets ....................................................373
Generating Servlet Web Deployment Descriptor
.......................................................................376
Generating WARs .......................................................376Reverse Engineering Servlets ....................................377
Java Server Pages (JSPs) .................................................379
JSP Page of the Component ......................................379
Defining File Objects for JSPs ....................................379
Creating a JSP with the Wizard ..................................380
Generating JSPs .........................................................381
Generating JSP Web Deployment Descriptor ....381
Reverse Engineering JSPs .........................................384Generating Java Files ........................................................385
Reverse Engineering Java Code ......................................389
Reverse Engineer Java Options Tab ...........................391
Reverse Engineering Java Code Comments .....393
Contents
xvi PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
17/688
CHAPTER 13: Working with the Eclipse ModelingFramework (EMF) .....................................................395
EMF Objects .......................................................................395EPackages .................................................................395
Eclasses, EEnums, and EDataTypes ..........................395
EAnnotations .............................................................396
Eattributes and EEnumLiterals ...................................396
EReferences ..............................................................396
EOperations and EParameters ...................................397
Generating EMF Files ........................................................397
Reverse Engineering EMF Files.......................................398
CHAPTER 14: Working with IDL.................................399
IDL Objects .........................................................................399
Generating for IDL .............................................................408
Reverse Engineering IDL Files .........................................409
CHAPTER 15: Working with PowerBuilder ...............411
PowerBuilder Objects ........................................................411Generating PowerBuilder Objects ....................................414
Reverse Engineering PowerBuilder .................................415
Reverse Engineered Objects ......................................415
Operation Reversed Header ..............................416
Overriding Attributes ..........................................417
PowerBuilder Reverse Engineering Process ..............417
Reverse Engineering PowerBuilder Objects ......418
Loading a PowerBuilder Library Model in theWorkspace .............................................................420
CHAPTER 16: Working with VB .NET........................421
Inheritance & Implementation ..........................................421
Contents
Object-Oriented Modeling xvii
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
18/688
Namespace .........................................................................421
Project .................................................................................421
Accessibility .......................................................................422
Classes, Interfaces, Structs, and Enumerations ............423
Module ...............................................................................424Custom Attributes .............................................................425
Shadows ............................................................................425
Variables ............................................................................426
Property .............................................................................427
Method ...............................................................................428
Constructor & Destructor .................................................430
Delegate .............................................................................430
Event ..................................................................................431
Event Handler .....................................................................432
External Method .................................................................432
Generating VB.NET Files ..................................................433
Reverse Engineering VB .NET ..........................................435
Selecting VB .NET Reverse Engineering Options ......435
Defining VB .NET Reverse Engineering Options
.......................................................................436
VB .NET Reverse Engineering Preprocessing ...........437
VB .NET Supported Preprocessing Directives.......................................................................438
Defining a VB .NET Preprocessing Symbol .......438
VB .NET Reverse Engineering with
Preprocessing ...............................................439
Reverse Engineering VB .NET Files ...........................440
Working with ASP.NET ......................................................441
ASP Tab of the Component ........................................441
Defining File Objects for ASP.NET ..............................442Creating an ASP.NET with the Wizard ........................442
Generating ASP.NET ..................................................444
CHAPTER 17: Working with Visual Basic 2005........447
Contents
xviii PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
19/688
Visual Basic 2005 Assemblies..........................................447
Visual Basic 2005 Compilation Units ...............................449
Partial Types ...............................................................451
Visual Basic 2005 Namespaces........................................451
Visual Basic 2005 Classes ................................................452Visual Basic 2005 Interfaces .............................................453
Visual Basic 2005 Structs .................................................453
Visual Basic 2005 Delegates .............................................454
Visual Basic 2005 Enums ..................................................455
Visual Basic 2005 Fields, Events, and Properties ..........456
Visual Basic 2005 Methods ...............................................459
Visual Basic 2005 Inheritance and Implementation.......460
Visual Basic 2005 Custom Attributes ..............................460
Generating Visual Basic 2005 Files .................................460
Reverse Engineering Visual Basic 2005 Code ................462
Visual Basic Reverse Engineer Dialog Options Tab ...463
Visual Basic Reverse Engineering Preprocessing
Directives ................................................................464
Visual Basic Supported Preprocessing
Directives .......................................................465
Defining a Visual Basic Preprocessing Symbol
.......................................................................465
CHAPTER 18: Working with C# ..................................467
Inheritance & Implementation..........................................467
Namespace.........................................................................467
Project .................................................................................467
Accessibility .......................................................................468
Classes, Interfaces, Structs, and Enumerations............469
Custom Attributes .............................................................471
Fields .................................................................................471
Property .............................................................................472
Indexer ...............................................................................473
Method ...............................................................................475
Contents
Object-Oriented Modeling xix
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
20/688
Constructor & Destructor .................................................477
Delegate .............................................................................477
Event ..................................................................................478
Operator Method ................................................................478
Conversion Operator Method ...........................................478Documentation Tags .........................................................479
Generating C# Files ...........................................................480
Reverse Engineering C# ...................................................482
Selecting C# Reverse Engineering Options ................483
Defining C# Reverse Engineering Options ........ 484
C# Reverse Engineering Preprocessing .....................484
C# Supported Preprocessing Directives............485
Defining a C# Preprocessing Symbol ................486
C# Reverse Engineering with Preprocessing.... 487
Reverse Engineering C# Files ....................................487
CHAPTER 19: Working with C# 2.0 ............................489
C# 2.0 Assemblies .............................................................489
C# 2.0 Compilation Units ..................................................491
Partial Types ............................................................... 492
C# 2.0 Namespaces ...........................................................493C# 2.0 Classes ....................................................................494
C# 2.0 Interfaces ................................................................495
C# 2.0 Structs .....................................................................495
C# 2.0 Delegates ................................................................496
C# 2.0 Enums.....................................................................497
C# 2.0 Fields .......................................................................498
C# 2.0 Methods ..................................................................498
C# 2.0 Events, Indexers, and Properties .........................501
C# 2.0 Inheritance and Implementation...........................504
C# 2.0 Custom Attributes ..................................................504
Generating C# 2.0 Files .....................................................504
Reverse Engineering C# 2.0 Code ...................................506
C# Reverse Engineer Dialog Options Tab .................. 507
Contents
xx PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
21/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
22/688
Table Per Class Hierarchy Inheritance Mapping
Strategy .........................................................547
Joined Subclass Inheritance Mapping Strategy
.......................................................................550
Table Per Class Inheritance Mapping Strategy.......................................................................551
CHAPTER 23: Generating Persistent Objects forJava and JSF Pages................................................553
Generating Hibernate Persistent Objects ........................553
Defining the Hibernate Default Options ......................553
Defining the Hibernate Database Configuration
Parameters .............................................................554Defining Hibernate Basic O/R Mappings ....................555
Defining Hibernate Class Mapping Options .......555
Defining Primary Identifier Mappings .................558
Defining Attribute Mappings ...............................562
Hibernate Association Mappings ................................563
Defining Hibernate Association Mapping
Options ..........................................................563
Collection Management Options ........................565Persistence Options ...........................................566
Mapping Collections of Value Types ..................567
Defining Hibernate Inheritance Mappings ..................568
Generating Code for Hibernate ...................................568
Checking the Model ...........................................569
Defining Generation Options .............................569
Generating Code for Hibernate ..........................570
Using the Generated Hibernate Code ........................571
Importing the Generated Project into Eclipse ....571
Performing the Unit Tests ...................................571
Running Unit Tests in Eclipse ............................572
Running Unit Tests with Ant ...............................574
Generating EJB 3 Persistent Objects ..............................575
Contents
xxii PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
23/688
Generating Entities for EJB 3.0 ..................................576
Defining EJB 3 Basic O/R Mapping ............................576
Defining Entity Mappings ...................................576
Defining Embeddable Class Mapping................579
Defining EJB 3 Association Mappings ........................580Mapping One-to-one Associations .....................580
Mapping One-to-many Associations ..................580
Mapping Many-to-many Associations ................581
Defining EJB 3 Association Mapping Options
.......................................................................582
Defining EJB 3 Inheritance Mappings ........................582
Mapped Superclasses .......................................583
Table Per Class Hierarchy Strategy ...................583
Joined Subclass Strategy ..................................583
Applying Table Per Class Strategy .....................584
Defining EJB 3 Persistence Default Options ...............584
Defining EJB 3 Persistence Configuration ..................584
Checking the Model ....................................................586
Generating Code for EJB 3 Persistence.....................587
Defining the Environment Variable .....................587
Generate Code ..................................................588
Authoring in Dali Tools .......................................590Run Unit Tests ...................................................590
Generated File List ............................................593
Generating JavaServer Faces (JSF) for Hibernate .........594
Defining Global Options ..............................................594
Defining Attribute Options ...........................................597
Derived Attributes ..............................................599
Attribute Validation Rules and Default Values
.......................................................................599Defining Master-Detail Pages .....................................600
Generating PageFlow Diagrams.................................602
Generating a class level PageFlow diagram ......602
Generating a Package Level PageFlow
Diagram: ........................................................603
Contents
Object-Oriented Modeling xxiii
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
24/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
25/688
Defining NHibernate Collection Container Type
.......................................................................634
Defining Inheritance Mappings ...................................634
Generating Code for NHibernate ................................635
Configuring Connection Strings ......................................636Configuring a Connection String from the ADO.NET or
ADO.NET CF Tab ...................................................637
Configuring a Connection String from the NHibernate
Tab ..........................................................................637
OLEDB Connection String Parameters ......................637
ODBC Connection String Parameters ........................638
Microsoft SQL Server and Microsoft SQL Server
Mobile Edition Connection String Parameters ........638
Oracle Connection String Parameters ........................638
Generating Code for Unit Testing ....................................639
Running NUnit Unit Tests ............................................641
Running Visual Studio Test System Unit Tests ...........642
Running Tests in Visual Studio.NET 2005 IDE
.......................................................................643
Running Tests from the Command Line ............643
Generating Windows or Smart Device Applications ......644
Specifying an Image Library .......................................644Controlling the Data Grid View ...................................644
Defining Attributes Display Options ............................644
Defining Attribute Validation Rules and Default Values
................................................................................645
Generating Code for a Windows Application ..............645
Generating Code for a Smart Device Application .......646
Deploying Code to a Smart Device ....................647
Testing the Application on the Device ................647
Index .........................................................................................649
Contents
Object-Oriented Modeling xxv
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
26/688
Contents
xxvi PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
27/688
PART I
Building OOMs
The chapters in this part explain how to model your information systems in
PowerDesigner®.
Object-Oriented Modeling 1
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
28/688
2 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
29/688
CHAPTER 1 Getting Started with Object-Oriented Modeling
An object-oriented model (OOM) helps you analyze an information system through use cases,
structural and behavioral analyses, and in terms of deployment, using the Unified Modeling
Language (UML). You can model, reverse-engineer, and generate for Java, .NET and other
languages.
PowerDesigner® supports the following UML diagrams:
• Use case diagram ( ) - see Chapter 2, Use Case Diagrams on page 17
• Structural Diagrams:
• Class diagram ( ) - see Class Diagrams on page 27• Composite structure diagram ( ) - see Composite Structure Diagrams on page 29
• Object diagram ( ) - see Object Diagrams on page 32
• Package diagram ( ) - see Package Diagrams on page 31
• Dynamic Diagrams:
• Communication diagram ( ) - see Communication D iagrams on page 123
• Sequence diagram ( ) - see Sequence Diag rams on page 125
• Activity diagram ( ) - see Activity Diag rams on page 129
• Statechart diagram ( ) - see Statechart Di agrams on page 131
• Interaction overview diagram ( ) - see Interactio n Overview Diagrams on page134
• Implementation Diagrams:
• Component diagram ( ) - see Compon ent Diagrams on page 207
• Deployment diagram ( ) - see Deployment Diagrams on page 209
In the picture below, you can see how the various UML diagrams can interact within your
model:
Object-Oriented Modeling 3
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
30/688
Suggested Bibliography
• James Rumbaugh, Ivar Jacobson, Grady Booch – The Unified Modeling Language
Reference Manual – Addison Wesley, 1999
• Grady Booch, James Rumbaugh, Ivar Jacobson – The Unified Modeling Language User
Guide – Addison Wesley, 1999
CHAPTER 1: Getting Started with Object-Oriented Modeling
4 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
31/688
• Ivar Jacobson, Grady Booch, James Rumbaugh – The Unified Software Development
Process – Addison Wesley, 1999
• Doug Rosenberg, Kendall Scott – Use Case Driven Object Modeling With UML A
Practical Approach – Addison Wesley, 1999
• Michael Blaha, William Premerlani – Object-Oriented Modeling and Design for Database
Applications – Prentice Hall, 1998• Geri Schneider, Jason P. Winters, Ivar Jacobson – Applying Use Cases: A Practical Guide
– Addison Wesley, 1998
• Pierre-Alain Muller – Instant UML – Wrox Press Inc, 1997
• Bertrand Meyer – Object-Oriented Software Construction – Prentice Hall, 2nd Edition,
1997
• Martin Fowler, Kendall Scott – UML Distilled Applying The Standard Object Modeling
Language – Addison Wesley, 1997
Creating an OOMYou create a new object-oriented model by selecting File > New Model.
Note: In addition to creating an OOM from scratch with the following procedure, you can also
reverse-engineer a model from existing OO code (see Reverse Engineering OO Source Files
into an OOM on page 269).
The New Model dialog is highly configurable, and your administrator may hide options that
are not relevant for your work or provide templates or predefined models to guide you through
model creation. When you open the dialog, one or more of the following buttons will be
available on the left hand side:• Categories - which provides a set of predefined models and diagrams sorted in a
configurable category structure.
• Model types - which provides the classic list of PowerDesigner model types and
diagrams.
• Template files - which provides a set of model templates sorted by model type.
CHAPTER 1: Getting Started with Object-Oriented Modeling
Object-Oriented Modeling 5
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
32/688
1. Select File > New Model to open the New Model dialog.
2. Click a button, and then select a category or model type ( Object-Oriented Model ) in the
left-hand pane.
3. Select an item in the right-hand pane. Depending on how your New Model dialog is
configured, these items may be first diagrams or templates on which to base the creation of
your model.
Use the Views tool on the upper right hand side of the dialog to control the display of the
items.
4. Enter a model name.
The code of the model, which is used for script or code generation, is derived from this
name using the model naming conventions.5. Select a target object language , which customizes PowerDesigner's default modifying
environment with target-specific properties, objects, and generation templates.
By default, PowerDesigner creates a link in the model to the specified file. To copy the
contents of the resource and save it in your model file, click the Embed Resource in
Model button to the right of this field. Embedding a file in this way enables you to make
CHAPTER 1: Getting Started with Object-Oriented Modeling
6 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
33/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
34/688
Previewing Object Code
Click the Preview tab in the property sheet of the model, packages, classes, and various other
model objects in order to view the code that will be generated for it.For example, if you have created EJB or servlet components in Java, the Preview tab displays
the EJB or Web deployment descriptor files. If you have selected an XML family language, the
Preview tab displays the Schema file that corresponds to the XML file to be generated.
If you have selected the Preview Editable option (available from Tools > Model Options),
you can modify the code of a classifier directly from its Preview tab. The modified code must
be valid and apply only to the present classifier or your modifications will be ignored. You can
create generalization and realization links if their classifiers already exist in the model, but you
cannot rename the classifier or modify the package declaration to move it to another package.
You should avoid renaming attributes and operations, as any other properties that are notgenerated (such as description, annotation or extended attributes) will be lost. Valid changes
are applied when you leave the Preview tab or click the Apply button.
In a model targeting PowerBuilder, this feature can be used to provide a global vision of the
code of an object and its functions which is not available in PowerBuilder. You can use the
Preview tab to check where instance variables are used in the code. You can also modify the
body of a function or create a new function from an existing function using copy/paste.
CHAPTER 1: Getting Started with Object-Oriented Modeling
8 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
35/688
The following tools are available on the Preview tab toolbar:
Tools Description
Editor Menu [Shift+F11] - Contains the following commands:
• New [Ctrl+N] - Reinitializes the field by removing all the existing content.
• Open... [Ctrl+O] - Replaces the content of the field with the content of the se-
lected file.
• Insert... [Ctrl+I] - Inserts the content of the selected file at the cursor.
• Save [Ctrl+S] - Saves the content of the field to the specified file.
• Save As... - Saves the content of the field to a new file.
• Select All [Ctrl+A] - Selects all the content of the field.
• Find... [Ctrl+F] - Opens a dialog to search for text in the field.
• Find Next... [F3] - Finds the next occurence of the searched for text.
• Find Previous... [Shift+F3] - Finds the previous occurence of the searched fortext.
• Replace... [Ctrl+H] - Opens a dialog to replace text in the field.• Go To Line... [Ctrl+G] - Opens a dialog to go to the specified line.
• Toggle Bookmark [Ctrl+F2] Inserts or removes a bookmark (a blue box) at thecursor position. Note that bookmarks are not printable and are lost if you refresh
the tab, or use the Show Generation Options tool
• Next Bookmark [F2] - Jumps to the next bookmark.
• Previous Bookmark [Shift+F2] - Jumps to the previous bookmark.
Edit With [Ctrl+E] - Opens the previewed code in an external editor. Click the down
arrow to select a particular editor or Choose Program to specify a new editor. Editors
specified here are added to the list of editors available at Tools > General Options >
Editors.
Save [Ctrl+S] - Saves the content of the field to the specified file.
Print [Ctrl+P] - Prints the content of the field.
Find [Ctrl+F] - Opens a dialog to search for text.
Cut [Ctrl+X], Copy [Ctrl+C], and Paste [Ctrl+V] - Perform the standard clipboardactions.
Undo [Ctrl+Z] and Redo [Ctrl+Y] - Move backward or forward through edits.
Refresh [F5] - Refreshes the Preview tab.
You can debug the GTL templates that generate the code shown in the Preview tab. To
do so, open the target or extension resource file, select the Enable Trace Mode option,
and click OK to return to your model. You may need to click the Refresh tool to
display the templates.
CHAPTER 1: Getting Started with Object-Oriented Modeling
Object-Oriented Modeling 9
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
36/688
Tools Description
Select Generation Targets [Ctrl+F6] - Lets you select additional generation targets(defined in extensions), and adds a sub-tab for each selected target. For information
about generation targets, see Customizing and Extending PowerDesigner > Extension
Files > Extending Generation and Creating Separate Generation Targets .
Show Generation Options [Ctrl+W] - Opens the Generation Options dialog, allow-
ing you to modify the generation options and to see the impact on the code. This feature
is especially useful when you are working with Java. For other object languages,generation options do not influence the code.
Customizing Object Creation Scripts
The Script tab allows you to customize the object's creation script by, for example, adding
descriptive information about the script.
Examples For example, if a project archives all generated creation scripts, a header can be inserted before
each creation script, indicating the date, time, and any other appropriate information or, if
generated scripts must be filed using a naming system other than the script name, a header
could direct a generated script to be filed under a different name.
You can insert scripts at the beginning (Header subtab) and the end (Footer subtab) of a script
or insert scripts before and after a class or interface creation command (Imports subtab)
The following tools and shortcut keys are available on the Script tab:
Tool Description
[Shift+F11] Open Editor Contextual menu
[Ctrl+E] Edit With - Opens your default editor.
Import Folder - [Imports sub-tab] Opens a selection window to select packages to
import to the cursor position, prefixed by the keyword 'import'.
Import Classifier - [Imports sub-tab] Opens a selection window to select classifiers to
import to the cursor position, prefixed by the keyword 'import'.
You can use the following formatting syntax with variables:
Format code Format of variable value in script
.L Lowercase characters
.T Removes blank spaces
CHAPTER 1: Getting Started with Object-Oriented Modeling
10 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
37/688
Format code Format of variable value in script
.U Uppercase characters
.c Upper-case first letter and lower-case next letters
.n Maximum length where n is the number of characters
.n J Justifies to fixed length where n is the number of characters
You embed formatting options in variable syntax as follows:
%.format:variable%
Customizing your Modeling Environment
The PowerDesigner object-oriented model provides various means for customizing and
controlling your modeling environment.
Setting OOM Model OptionsYou can set OOM model options by selecting Tools > Model Options or right-clicking the
diagram background and selecting Model Options. These options affect all the objects in the
model, including those already created.
You can set the following options:
Option Definition
Name/Code casesensitive Specifies that the names and codes for all objects are case sensitive, allowing youto have two objects with identical names or codes but different cases in the same
model. If you change case sensitivity during the design process, we recommend
that you check your model to verify that your model does not contain any du-plicate objects.
Enable links to re-quirements
Displays a Requirements tab in the property sheet of every object in the model,which allows you to attach requirements to objects (see Requirements Model-
ing ).
Show classes as
data types
Includes classes of the model in the list of data types defined for attributes or
parameters, and return types defined for operations.
Preview editable Applies to reverse engineering. You can edit your code from the Preview page of a class or an interface by selecting the Preview Editable check box. This allowsyou to reverse engineer changes applied to your code directly from the Preview
page.
CHAPTER 1: Getting Started with Object-Oriented Modeling
Object-Oriented Modeling 11
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
38/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
39/688
Setting OOM Display PreferencesPowerDesigner display preferences allow you to customize the format of object symbols, and
the information that is displayed on them. To set object-oriented model display preferences,
select Tools > Display Preferences or right-click the diagram background and select Display
Preferences from the contextual menu.
For detailed information about customizing and controlling the attributes and collections
displayed on object symbols, see Core Features Guide > The PowerDesigner Interface >
Diagrams, Matrices, and Symbols > Display Preferences .
Viewing and Editing the Object Language Definition FileEach OOM is linked to a definition file that extends the standard PowerDesigner metamodel to
provide objects, properties, data types, and generation parameters and templates specific to
the language being modeled. Definition files and other resource files are XML files located in
the Resource Files directory inside your installation directory, and can be opened and
edited in the PowerDesigner Resource Editor.
Warning! We strongly recommend that you make a back up of the resource files delivered
with PowerDesigner before editing them.
To open your model's definition file and review its extensions, select Language > Edit
Current Object Language.
For detailed information about the format of these files, see Customizing and Extending
PowerDesigner > Object, Process, and XML Language Definition Files .
Note: Some resource files are delivered with "Not Certified" in their names. Sybase® will
perform all possible validation checks, however Sybase does not maintain specific
environments to fully certify these resource files. Sybase will support the definition by
accepting bug reports and will provide fixes as per standard policy, with the exception that
there will be no final environmental validation of the fix. Users are invited to assist Sybase by
testing fixes of the definition provided by Sybase and report any continuing inconsistencies.
Changing the Object LanguageYou can change the object language being modeled in your OOM at any time.
Note: You may be required to change the object language if you open a model and the
associated definition file is unavailable. Language definition files are frequently updated ineach version of PowerDesigner and it is highly recommended to accept this change, or
otherwise you may be unable to generate for the selected language.
1. Select Language > Change Current Object Language:
CHAPTER 1: Getting Started with Object-Oriented Modeling
Object-Oriented Modeling 13
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
40/688
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
41/688
To get started extending objects, see Core Features Guide > The PowerDesigner Interface >
Objects > Extending Objects . For detailed information about working with extensions, seeCustomizing and Extending PowerDesigner > Extension Files .
Linking Objects with Traceability LinksYou can create traceability links to show any kind of relationship between two model objects
(including between objects in different models) via the Traceability Links tab of the object's
property sheet. These links are used for documentation purposes only, and are not interpreted
or checked by PowerDesigner.
For more information about traceability links, see Core Features Guide > Linking and
Synchronizing Models > Getting Started with Linking and Syncing > Creating Traceability Links .
CHAPTER 1: Getting Started with Object-Oriented Modeling
Object-Oriented Modeling 15
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
42/688
CHAPTER 1: Getting Started with Object-Oriented Modeling
16 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
43/688
CHAPTER 2 Use Case Diagrams
A use case diagram is a UML diagram that provides a graphical view of the requirements of your system, and helps you identify how users interact with it.
Note: To create a use case diagram in an existing OOM, right-click the model in the Browser
and select New > Use Case Diagram. To create a new model, select File > New Model,
choose Object Oriented Model as the model type and Use Case Diagram as the first diagram,
and then click OK.
With a use case diagram, you immediately see a snapshot of the system functionality. Further
details can later be added to the diagram if you need to elucidate interesting points in the
system behavior.
A use case diagram is well suited to the task of describing all of the things that can be done witha database system by all the people who might use it. However, it would be poorly suited to
describing the TCP/IP network protocol because there are many exception cases, branching
behaviors, and conditional functionality (what happens when the connection dies, what
happens when a packet is lost?)
In the following example, the actor "photographer" does two things with the camera: take
pictures and change the film. When he takes a picture, he has to switch the flash on, open the
shutter, and then close the shutter but these activities are not of a high enough level to be
represented in a use case.
Object-Oriented Modeling 17
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
44/688
Use Case Diagram Objects
PowerDesigner supports all the objects necessary to build use case diagrams.
Object Tool Symbol Description
Actor Used to represent an external person, process or
something interacting with a system, sub-system or
class. See Actors (OOM) on page 20.
Use case Defines a piece of coherent behavior in a system,
without revealing its internal structure. See Use
Cases (OOM) on page 18.
Association Communication path between an actor and a use
case that it participates in. See Use Case Associa-
tions (OOM) on page 24.
Generalization A link between a general use case and a more spe-cific use case that inherits from it and add features
to it. See Generalizations (OOM) on page 95.
Dependency Relationship between two modeling elements, in
which a change to one element will affect the otherelement. See Dependencies (OOM) on page 98.
Use Cases (OOM)A use case is an interaction between a user and a system (or part of a system). It defines a
discrete goal that a user wants to achieve with the system, without revealing the system's
internal structure.
A use case can be created in the following diagrams:
• Use Case Diagram
Example In this example, "buy tickets" and "buy subscriptions" are use cases.
CHAPTER 2: Use Case Diagrams
18 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
45/688
Creating a Use CaseYou can create a use case from the Toolbox, Browser, or Model menu.
• Use the Use Case tool in the Toolbox.
• Select Model > Use Cases to access the List of Use Cases, and click the Add a Row tool.• Right-click the model (or a package) in the Browser, and select New > Use Case.
For general information about creating objects, see Core Features Guide > The
PowerDesigner Interface > Objects .
Use Case PropertiesTo view or edit a use case's properties, double-click its diagram symbol or Browser or list
entry. The property sheet tabs and fields listed here are those available by default, before any
customization of the interface by you or an administrator.
The General tab contains the following properties:
Property Description
Name/Code/
Comment
Identify the object. The name should clearly convey the object's purpose to non-
technical users, while the code, which is used for generating code or scripts, may
be abbreviated, and should not normally include spaces. You can optionally add a
comment to provide more detailed information about the object. By default the
code is generated from the name by applying the naming conventions specified in
the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.
Stereotype Extends the semantics of the object beyond the core UML definition. You can
enter a stereotype directly in this field, or add stereotypes to the list by specifying
them in an extension file.
Keywords Provide a way of loosely grouping objects through tagging. To enter multiple
keywords, separate them with commas.
Specification Tab The Specification tab contains the following properties, available on sub-tabs at the bottom of
the dialog:
Property Description
Action Steps Specifies a textual description of the normal sequence of actions associated with a
use case.
For example, the action steps for a use case called 'register patient' in a hospital
might be as follows: "Open a file, give a new registration number, write down
medical treatment".
CHAPTER 2: Use Case Diagrams
Object-Oriented Modeling 19
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
46/688
Property Description
Extension Points Specifies a textual description of actions that extend the normal sequence of
actions. Extensions are usually introduced with an "if ....then" statement.
For example, an extension to the action steps above might be: "If the patient
already has a registration number, then retrieve his personal file".
Exceptions Specifies signals raised in response to errors during system execution.
Pre-Conditions Specifies constraints that must be true for an operation to be invoked.
Post-Conditions Specifies constraints that must be true for an operation to exit correctly.
Implementation Classes Tab A use case is generally a task or service, represented as a verb. When analyzing what a use case
must do, you can identify the classes and interfaces that need to be created to fulfill the task,
and attach them to the use case. The Implementation Classes tab lists the classes and interfacesused to implement a use case. The following tools are available:
Tool Action
Add Objects – Opens a dialog box to select any class or interface in the model to implement
the use case.
Create a New Class – Creates a new class to implement the use case.
Create a New Interface - Creates a new interface to implement the use case.
For example, a use case Ship product by express mail could be implemented by the classesShipping , Product , and Billing .
Related Diagrams Tab The Related Diagrams tab lists diagrams that help you to further understand the use case. Click
the Add Objects tool to add diagrams to the list from any model open in the workspace. For
more information, Core Features Guide > The PowerDesigner Interface > Diagrams,
Matrices, and Symbols > Diagrams > Specifying Diagrams as Related Diagrams .
Actors (OOM)An actor is an outside user or set of users that interact with a system. Actors can be humans or
other external systems. For example, actors in a computer network system may include a
system administrator, a database administrator and users. Actors are typically those entities
whose behavior you cannot control or change, because they are not part of the system that you
are describing.
An actor can be created in the following diagrams:
CHAPTER 2: Use Case Diagrams
20 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
47/688
• Communication Diagram
• Sequence Diagram
• Use Case Diagram
A single actor object may be used in a use case, a sequence, and a communication diagram if it
plays the same role in each. Each actor object is available to all the diagrams in your OOM.They can either be created in the diagram type you need, or dragged from a diagram type and
dropped into another diagram type.
Actors in a Use Case Diagram
In the use case diagram, an actor is a primary actor for a use case if he asks for and/or triggers
the actions performed by a use case. Primary actors are located to the left of the use case, and
the association linking them should be drawn from the actor to the use case.
An actor is a secondary actor for a use case if it does not trigger the actions, but rather assists
the use case to complete the actions. After performing an action, the use case may give results,
documents, or information to the outside and, if so, the secondary actor may receive them.Secondary actors are located to the right of the use case, and the association linking them
should be drawn from the use case to the actor.
On a global scale, a secondary actor for one use case may be a primary actor for another use
case, either in the same or another diagram.
Actors in a Communication Diagram In a communication diagram, an actor may be connected to an object by an instance link, or
may send or receive messages.
Actors in a Sequence Diagram In the sequence diagram, an actor has a lifeline representing the duration of its life. You cannot
separate an actor and its lifeline.
CHAPTER 2: Use Case Diagrams
Object-Oriented Modeling 21
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
48/688
If an actor is the invoker of the interaction, it is usually represented by the first (farthest left)
lifeline in the sequence diagram. If you have several actors in the diagram, you should try to
position them to the farthest left or to the farthest right lifelines because actors are, by
definition, external to the system.
Creating an ActorYou can create an actor from the Toolbox, Browser, or Model menu.
• Use the Actor tool in the Toolbox.
• Select Model > Actors to access the List of Actors, and click the Add a Row tool.• Right-click the model (or a package) in the Browser, and select New > Actor.
For general information about creating objects, see Core Features Guide > The
PowerDesigner Interface > Objects .
Actor PropertiesTo view or edit an actor's properties, double-click its diagram symbol or Browser or list entry.
The property sheet tabs and fields listed here are those available by default, before any
customization of the interface by you or an administrator.
The General tab contains the following properties:
CHAPTER 2: Use Case Diagrams
22 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
49/688
Property Description
Name/Code/
Comment
Identify the object. The name should clearly convey the object's purpose to non-
technical users, while the code, which is used for generating code or scripts, may
be abbreviated, and should not normally include spaces. You can optionally add a
comment to provide more detailed information about the object. By default thecode is generated from the name by applying the naming conventions specified in
the model options. To decouple name-code synchronization, click to release the
= button to the right of the Code field.
Stereotype Extends the semantics of the object beyond the core UML definition. You can
enter a stereotype directly in this field, or add stereotypes to the list by specifying
them in an extension file.
Keywords Provide a way of loosely grouping objects through tagging. To enter multiple
keywords, separate them with commas.
Implementation Classes Tab An actor can be a human being (person, partner) or a machine, or process (automated system).
When analyzing what an actor must do, you can identify the classes and interfaces that need to
be created for the actor to perform his task, and attach them to the actor. The Implementation
Classes tab lists the classes and interfaces used to implement the actor. The following tools are
available:
Tool Action
Add Objects – Opens a dialog box to select any class or interface in the model to implement
the actor.
Create a New Class – Creates a new class to implement the actor.
Create a New Interface - Creates a new interface to implement the actor.
For example, an actor Car could be implemented by the classes Engine and Motorway.
Conceptually, you may link elements even deeper. For example, a clerk working in an
insurance company is represented as an actor in a use case diagram, dealing with customers
who declare a car accident.
The clerk actor becomes an object in a communication or sequence diagram, receivingmessages from customers and sending messages to his manager, which is an instance of the
Clerk class in a class diagram with its associated attributes and operations:
CHAPTER 2: Use Case Diagrams
Object-Oriented Modeling 23
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
50/688
Related Diagrams Tab
The Related Diagrams tab lists diagrams that help you to further understand the actor. Click the Add Objects tool to add diagrams to the list from any model open in the workspace. For
more information, see Core Features Guide > The PowerDesigner Interface > Diagrams,
Matrices, and Symbols > Diagrams > Specifying Diagrams as Related Diagrams .
Reusing ActorsThe same actor can be used in a Use Case Diagram, Communication Diagram, and Sequence
Diagram. To reuse an actor created in one diagram in another diagram:
• Select the actor you need in the Browser, and drag it and drop it into the new diagram.
• Select Symbols > Show Symbols in the new diagram to open the Show Symbols dialog
box, select the actor to display, and click OK.
Use Case Associations (OOM)
An association is a unidirectional relationship that describes a link between objects.
Use case associations can only be created in use case diagrams. You can create them by
drawing from:
• An actor to a use case - an input association
• A use case to an actor - an output association
The UML standard does not explicitly display the direction of the association, and instead has
the position of actors imply it. When an actor is positioned to the left of the use case, the
association is an input, and when he is to the right, it is an output. To explicitly display the
orientation of the association click Tools > Display Preferences, select Use Case
Association in the Category tree, and select the Orientation option. For detailed information
about working with display preferences, see Core Features Guide > The PowerDesigner
Interface > Diagrams, Matrices, and Symbols > Display Preferences .
CHAPTER 2: Use Case Diagrams
24 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
51/688
Example
Creating a Use Case Association
You can create use case association from the Toolbox, Browser, or Model menu.
• Use the Use Case Association tool in the Toolbox.
• Select Model > Associations to access the List of Associations, and click the Add a Row
tool.
• Right-click the model (or a package) in the Browser, and select New > Association.
For general information about creating objects, see Core Features Guide > The
PowerDesigner Interface > Objects .
Use Case Association PropertiesTo view or edit an association's properties, double-click its diagram symbol or Browser or list
entry. The property sheet tabs and fields listed here are those available by default, before any
customization of the interface by you or an administrator.
The General tab contains the following properties:
Property Description
Name/Code/Com-
ment
Identify the object. The name should clearly convey the object's purpose to
non-technical users, while the code, which is used for generating code orscripts, may be abbreviated, and should not normally include spaces. You can
optionally add a comment to provide more detailed information about the
object. By default the code is generated from the name by applying the namingconventions specified in the model options. To decouple name-code synchro-
nization, click to release the = button to the right of the Code field.
Stereotype Extends the semantics of the object beyond the core UML definition. You canenter a stereotype directly in this field, or add stereotypes to the list by speci-
fying them in an extension file.
CHAPTER 2: Use Case Diagrams
Object-Oriented Modeling 25
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
52/688
Property Description
Orientation Defines the direction of the association. You can choose between:
• Primary Actor – the association leads from the actor to the use case
• Secondary Actor – the association leads from the use case to the actor
Source Specifies the object that the association leads from. Use the tools to the right of the list to create, browse for, or view the properties of the currently selected
object.
Destination Specifies the object that the association leads to. Use the tools to the right of the
list to create, browse for, or view the properties of the currently selected object.
Keywords Provide a way of loosely grouping objects through tagging. To enter multiple
keywords, separate them with commas.
CHAPTER 2: Use Case Diagrams
26 PowerDesigner
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
53/688
CHAPTER 3 Structural Diagrams
The diagrams in this chapter allow you to model the static structure of your system.PowerDesigner provides three types of diagrams for modeling your system in this way, each
of which offers a different view of your objects and their relationships:
• A class diagram shows the static structure of the classes that make up the system. You use a
class diagram to identify the kinds of objects that will compose your system, and to define
the ways in which they will be associated. For more information, see Class Diagrams on
page 27.
• A composite structure diagram allows you to define in greater detail the internal structure
of your classes and the ways that they are associated with one another. You use a composite
structure diagram in particular to model complex forms of composition that would be very
cumbersome to model in a class diagram. For more information, see Composite Structure Diagrams on page 29.
• An object diagram is like a class diagram, except that it shows specific object instances of
the classes. You use an object diagram to represent a snapshot of the relationships between
actual instances of classes. For more information, see Object Diagrams on page 32.
• A package diagram shows the structure of the packages that make up your application, and
the relationships between them. For more information, see Package Diagrams on page
31.
Class DiagramsA class diagram is a UML diagram that provides a graphical view of the classes, interfaces,
and packages that compose a system, and the relationships between them.
Note: To create a class diagram in an existing OOM, right-click the model in the Browser and
select New > Class Diagram. To create a new model, select File > New Model, choose Object
Oriented Model as the model type and Class Diagram as the first diagram, and then click
OK.
You build a class diagram to simplify the interaction of objects in the system you are modeling.
Class diagrams express the static structure of a system in terms of classes and relationships
between those classes. A class describes a set of objects, and an association describes a set of
links; objects are class instances, and links are association instances.
A class diagram does not express anything specific about the links of a given object, but it
describes, in an abstract way, the potential link from an object to other objects.
The following example shows an analysis of the structure of peripherals in a class diagram:
Object-Oriented Modeling 27
-
8/20/2019 POWER-DeSIGNER Object Oriented Modeling
54/688
Class Diagram ObjectsPowerDesigner supports all the objects necessary to build class diagrams.
Object Tool Symbol Description
Class Set of objects sharing the same attributes, opera-
tions, methods, and relationships. See Classes
(OOM) on page 34.
Interface Descriptor for the externally visible operations of a
class, object, or other entity without specificationof internal structure. See Interfaces (OOM) on
page 51.
Port Interaction point between a classifier and its envi-
ronment. See P