Professional Documents
Culture Documents
Sybase PowerDesigner
12.5
Windows
ii
Contents
I OOM Guide
ix
xi
1
2
6
9
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
13
15
16
19
22
25
27
51
55
59
65
68
72
82
86
102
115
119
124
126
128
130
132
136
141
146
iii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
149
150
153
157
161
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
165
167
168
172
177
180
184
186
203
207
210
214
230
234
238
240
242
246
249
257
259
266
270
274
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
277
278
279
282
284
296
300
303
306
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
312
316
321
323
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
325
326
331
342
352
355
363
368
380
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
389
390
391
400
433
435
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
437
438
439
441
443
444
.
.
.
.
.
.
.
.
.
.
455
456
457
460
470
487
491
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
493
494
495
496
500
506
508
509
546
554
565
574
583
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
607
608
611
614
618
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
625
626
640
643
650
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
657
658
659
662
666
667
669
670
672
674
676
vi
.
.
.
.
.
.
.
.
.
.
.
.
.
679
681
682
683
687
17 Working with C#
Designing for C# . . . . . . . . . . . . . . . . . . . . . . . . .
Generating for C# . . . . . . . . . . . . . . . . . . . . . . . .
Reverse engineering C# . . . . . . . . . . . . . . . . . . . . .
693
694
710
713
721
722
723
726
730
731
734
735
737
739
741
742
746
750
751
752
755
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
781
vii
viii
PART I
OOM G UIDE
xi
xii
central repository.
Typographic conventions
PowerDesigner documentation uses specific typefaces to help you readily
identify specific items:
monospace text (normal and bold)
Used for: Code samples, commands, compiled functions and files,
references to variables.
Example: declare user_defined..., the BeforeInsertTrigger
template.
bold text
Any new term.
Example: A shortcut has a target object.
SMALL CAPS
xiii
xiv
CHAPTER 1
Contents
page
What is an OOM?
Creating an OOM
What is an OOM?
What is an OOM?
An Object-Oriented Model (OOM) is a graphical analysis of a system using
the symbols and language notations of the Unified Modeling Language
(UML). UML is the standard language for object-oriented modeling. It was
originally devised by Grady Booch, James Rumbaugh, and Ivar Jacobson,
and is now controlled by the OMG (Object Management Group).
UML has a well-defined syntax and semantics that is clear and easy to use in
object modeling. The terminology used in the OOM interface is consistent
with UML, and PowerDesigner supports the following UML diagrams:
Diagram Group
Icon
Diagram
Structural Diagrams
Class diagram
Object diagram
Package diagram
Dynamic Diagrams
Communication diagram
Sequence diagram
Statechart diagram
Activity diagram
Implementation Diagrams
Component diagram
Diagram Group
Icon
Diagram
Deployment diagram
What is an OOM?
PowerDesigner
Creating an OOM
Creating an OOM
You can create a new OOM from scratch, or reverse engineer the model
from existing OO code.
OOM properties
The Model property sheet displays the definition of the current model.
An OOM has the following model properties:
Creating an OOM
Property
Description
Name
Code
Comment
Filename
Author
Version
Version of the model. You can use this box to display the
repository version or a user defined version of the model.
This parameter is defined in the display preferences of the
Title node
Object language
Default diagram
+ For detailed information about generating code see the Generating for a
Language chapter.
Description
Keyboard shortcut
S HIFT + F11
Refresh
F5
CTRL
+W
CTRL
+ F6
Showing generation
options
If you click the Show Generation Options tool, the Generation Options
dialog box is displayed. You can change generation options from this dialog
box.
Select Generation
Targets
When available, this tool displays the list of target extended model
definitions selected for generation. If you add a generation target, the
corresponding tab is added to the Preview tab. If you deselect a generation
target, the corresponding tab disappears from the Preview tab. This tool is
9
In the Preview tab, you can add and remove bookmarks at specific points in
the code and then navigate forwards or backwards from bookmark to
bookmark:
Keyboard
shortcut
CTRL
+ F2
F2
SHIFT
Description
+ F2
Note that bookmarks are not printable and are lost if you use the Refresh, or
Show Generation Options tools.
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. However,
it is still strongly recommended to be very careful when performing such
actions.
Caution
You should avoid renaming attributes and operations because all attributes
that are not generated, like description, annotation or extended attributes
will be lost.
11
12
CHAPTER 2
This chapter describes how to build class, composite structure, and object
diagrams, and how to create and modify the associated objects.
Topic:
page
15
16
19
22
25
Classes (OOM)
27
Packages (OOM)
51
Interfaces (OOM)
55
Objects (OOM)
59
Parts (OOM)
65
Ports (OOM)
68
Attributes (OOM)
72
Identifiers (OOM)
82
Operations (OOM)
86
Associations (OOM)
102
Generalizations (OOM)
115
Dependencies (OOM)
119
Realizations (OOM)
124
126
128
130
13
Topic:
14
page
Annotations (OOM)
132
136
Domains (OOM)
141
146
15
Class
16
Tool
Symbol
Description
Object
Tool
Symbol
Description
Interface
Port
Generalization
Require Link
Association
Structural relationship between objects of different classes. See Associations (OOM) on page 102.
Aggregation
Composition
Dependency
17
Object
Tool
Symbol
Description
Realization
Inner link
Attribute
N/A
N/A
Operation
N/A
N/A
18
Tool
Symbol
Description
Class
Interface
19
Object
20
Tool
Symbol
Description
Port
Part
Generalization
Require Link
Assembly Connector
Delegation
Connector
Association
Structural relationship between objects of different classes. See Associations (OOM) on page 102.
Aggregation
Composition
Object
Tool
Symbol
Description
Dependency
Realization
Attribute
N/A
N/A
Operation
N/A
N/A
21
22
You can drag classes and associations from the Browser and drop them into
an object diagram. If you drag classes, new objects as instances of classes
are created. If you drag an association, a new instance link as instance of
the association, and two objects are created.
23
Tool
Symbol
Object
Attribute values
Description
N/A
Instance link
Dependency
24
25
Tool
Symbol
Description
Package
Generalization
Dependency
26
Classes (OOM)
A class is a description of a set of objects that have a similar structure and
behavior, and share the same attributes, operations, relationships, and
semantics.
A class can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
The structure of a class is described by its attributes and associations, and
its behavior is described by its operations.
Classes, and the relationships that you create between them, form the basic
structure of an OOM. A class defines a concept within the application being
modeled, such as:
a physical thing (like a car),
a business thing (like an order)
a logical thing (like a broadcasting schedule),
an application thing (like an OK button),
a behavioral thing (like a task)
The following example shows the class Aircraft with its attributes (range and
length) and operation (startengines).
Creating a class
You can create a class in any of the following ways:
Use the Class tool in the diagram Palette
Select Model Classes to access the List of Classes, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New Class
Right-click an interface, and select Create Class from the contextual
menu (this method allows you to inherit all the operations of the
interface, including the getter and setter operations, creates a realization
27
Classes (OOM)
link between the class and the interface, and shows this link in the
Realizes sub-tab of the Dependencies tab of the class property sheet).
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Class properties
You can modify an objects properties from its property sheet. To open a
class property sheet, double-click its diagram symbol or its Browser entry in
the Classes folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for classes.
Class property sheet General tab
The General tab contains the following properties:
28
Property
Description
Name
Code
Comment
Extends
Specifies the parent class (to which the present class is linked
by a generalization). Click the Select Classifier tool to the
right to specify a parent class and click the Properties tool to
access its property sheet.
Property
Description
Stereotype
Visibility
29
Classes (OOM)
Property
Description
Cardinality
Type
Abstract
Final
Generate
code
30
Description
Persistent
Code
Inner to
Association
class
Classes (OOM)
the Detail page of the class section, in the Working with Web Services
chapter.
Class property sheet Attributes tab
The Attributes tab lists the attributes associated with the class. You can
create attributes directly in this tab, or add already existing attributes. For
more information, see the Attributes (OOM) on page 72 section.
Class property sheet Identifiers tab
The Identifiers tab lists the identifiers associated with the class. You can
create identifiers directly in this tab. For more information, see the
Identifiers (OOM) on page 82 section.
Class property sheet Operations tab
The Operations tab lists the operations associated with the class. You can
create operations directly in this tab, or add already existing operations. For
more information, see the Operations (OOM) on page 86 section.
Class property sheet Ports tab
The Ports tab lists the ports associated with the class. You can create ports
directly in this tab. For more information, see the Ports (OOM) on
page 68 section.
Class property sheet Parts tab
The Parts tab lists the parts associated with the class. You can create parts
directly in this tab. For more information, see the Parts (OOM) on
page 65 section.
Class property sheet Associations tab
The Associations tab lists the associations associated with the class. For
more information, see the Associations (OOM) on page 102 section.
Class property sheet Inner Classifiers tab
The Inner Classifiers tab lists the inner classes and interfaces associated with
the class. You can create inner classifiers directly in this tab. For more
information, see the Composite and inner classifiers on page 44 section.
32
If a development project archives all the creation scripts that are generated, a
header script can be inserted before each creation script, indicating the date,
time, and any other information specific to the generated script.
If an organization requires that generated scripts are filed using a naming
system which may be independent from a script name, a header script could
direct a generated script to be filed under a different name than the name
indicated in the creation script.
Scripts can be customized as follows:
Insert scripts at the beginning (Header page) and the end (Footer page) of
a script
Insert scripts before and after a class or interface creation command
(Imports page)
Script tools
The following tools and shortcut keys are available on the Script tab:
33
Classes (OOM)
Tool
Description
Shortcut Key
S HIFT + F11
Edit With - Opens the default editor you previously defined or allows you to select another
editor if you click the down arrow beside this
tool
CTRL
+E
Variables have a syntax that can force a format on their values in the
following ways:
Force values to lowercase or uppercase characters
Truncate the length of values
When a variable does not specify formatting, its values have the same format
as in the OOM. You can use the following formatting syntax with variables:
Format code
.L
Lowercase characters
.T
.U
Uppercase characters
.c
.n
.n J
%.format:variable%
Preview tools
The following tools and shortcut keys are available on the Preview tab:
35
Classes (OOM)
Tool
Description
Shortcut Key
S HIFT + F11
Refresh.
F5
CTRL
+W
CTRL
+ F6
In the Preview tab, you can add and remove bookmarks at specific points in
the code and then navigate forwards or backwards from bookmark to
bookmark:
Shortcut
CTRL
+ F2
F2
SHIFT
Description
+ F2
Note that bookmarks are not printable and are lost if you use the Refresh, or
Show Generation Options tools.
36
Operations created
37
Classes (OOM)
38
39
Classes (OOM)
2. Select the classes for which you want to generate Java BeanInfo classes
and click OK.
A BeanInfo class is created in the model for each selected class.
1. Right-click a class in the diagram, and select Create BeanInfo Class from
the contextual menu.
In order for the classifier to become a true generic type, it must contain at
least one generic method.
Creating generic methods
PowerDesigner allows you to designate operations as generic methods.
Generic methods are methods that have their own list of type variables.
41
Classes (OOM)
2. Enter a Name and Code for the specialized classifier, and then click Next
to go to the type parameters page.
42
3. Specify values for each of the type parameters in the list. If you do not
specify a value for a type parameter, it will be added as a type parameter
to the new specialized classifier.
4. Click Finish to return to the diagram. The wizard will have created the
specialized classifier and also a bound classifier which acts as an
intermediary between the generic and the specialized classifiers, in order
to specify values for the type parameters.
The bound classifier is attached to the generic classifier via a dependency
with a stereotype of <<bind>>, and acts as the parent of the specialized
classifier, which is connected to it by a generalization.
In the example below, SpecializedClass inherits from GenericClass via
GenericClass_Bound, which specifies type parameters for the generic
types T, T_2, and T_3.
At compile time, the specialized classifier can inherit the methods and
properties of the generic classifier, and the generic type variables will be
replaced by actual types. As a result, the compiler will be able to provide
stronger type checking and automatic casting of the associated return
values.
Creating a bound classifier
You may need to bind a classifier to a generic classifier without creating a
specialized classifier. The Bound Classifier Wizard can do this for you.
v To create a bound classifier with the Bound Classifier Wizard
1. Right-click a generic class or interface, and select Create Bound Class (or
Interface) from the contextual menu to launch the Bound Classifier
Wizard.
2. The wizard will create the bound classifier, which is attached to the
generic classifier via a dependency with a stereotype of <<bind>>.
43
Classes (OOM)
The bound class Vector_Integer specifies a type Integer for the type
parameter <T> of Vector<T>. The SimpleVectorProgram class is
associated to Vector_Integer, allowing it to use the attribute data type of the
Vector class set to Integer.
44
45
Classes (OOM)
two classes in the diagram. The first class will become a composite class
and the second, an inner classifier
Create a composite classifier diagram dedicated to the class (see
following section), and create classes or interfaces there.
All inner classifiers are listed in the bottom of the class symbol
Creating a composite classifier diagram
You may want to create a diagram to show the internal structure of a
composite classifier. You can create a composite classifier diagram in any of
the following ways:
Right-click a class or interface in the Browser, and select New Class
Diagram
Double-click a class or interface in the diagram while holding down the
CTRL key
The composite classifier diagram will be empty by default, even if the
composite classifier already includes some inner classifiers. You can create
symbols for the internal classifiers by selecting Symbol Show Symbols, or
by dragging and dropping them from the Browser to the diagram.
If you have created a composite classifier diagram, you can display it in the
main class diagram by right-clicking the class symbol and selecting
Composite View.
46
If the classifier belongs to another package of the same model, you can
manually attach the classifier to a data type or return type by typing the fully
qualified name of the classifier directly in the data type or return type box.
For example, if you need to reference Class_2 as a classifier data type of an
attribute named Attr_1 in Class_1, open the Attr_1 property sheet and type
PACKAGE_2.CLASS_2 in the Data type list.
Package_1
|__ Class_1
|__ Attr_1
Package_2
|__ Class_2
After you type the fully qualified name (path and classifier name), it is
displayed in the data type or return type box.
When a data type or a return type is created, there is no classifier attached to
it, that is why the Use fully qualified name check box is not selected in the
Select a Classifier dialog box.
47
Classes (OOM)
v To attach a classifier
1. Double-click a class in the diagram to display its property sheet.
To attach a classifier to an attribute data type, click the Attributes tab,
select an attribute in the list, and click the Properties tool to open the
attribute property sheet.
To attach a classifier to an operation return type, click the Operations
tab, select an operation in the list, and click the Properties tool to open
the operation property sheet.
To attach a classifier to an operation parameter data type, click the
Operations tab, select an operation in the list, and click the Properties
tool to open the operation property sheet. Then click the Parameters
tab, select a parameter in the list, and click the Properties tool to open
the parameter property sheet
2. Click the Select a Classifier button beside the Data type listbox to open
the Selection window. This window contains a list of all the classifiers in
the model.
3. Select the classifier to be attached and click OK to return to the property
sheet. The classifier name is now displayed in the Data type list.
4. Click OK.
Synchronizing data type and classifier
When you select a data type that matches the code of a classifier, the data
type is automatically synchronized if the code of the classifier changes.
If you preview the generated code of the class Employee, you can see the
following three attributes (in Java language):
48
When a class inherits from a parent class through a generalization link, you
can use the list of Inherited Associations to view the list of migrated
attributes from the parent of the current class.
For example, the class Developer inherits from Employee through a
generalization.
If you double-click the class Developer, click the Associations tab in the
class property sheet and click the Inherited button, the list of Inherited
Associations displays the migrated attribute of the class Employee.
49
Classes (OOM)
50
Packages (OOM)
A package is a general purpose mechanism for organizing elements into
groups. It contains model objects and is available for creation in all
diagrams.
When you work with large models, you can split them into smaller
subdivisions to avoid manipulating the entire set of data of the model.
Packages can be useful to assign portions of a model, representing different
tasks and subject areas to different development teams.
Package hierarchy
You can create several packages at the same hierarchical level within a
model or decompose a package into other packages and continue this
process without limitation in decomposition depth. Each package is
displayed with a default diagram window. At each level of decomposition
you can create several diagrams.
However, in an activity or statechart diagram, it is not possible to create a
package in a composite activity or composite state since those ones are
behaving like a package.
You can expand a package to have a global view of the whole diagram
content.
To do so, you have to right-click a package and select Composite View from
the contextual menu. You must resize the composite package symbol to
visualize its content:
51
Packages (OOM)
You can create any type of diagrams in a package, or in a model. You use
packages to organize your objects into functional or organizational domains.
If you delete a package, you also delete the diagrams and the objects it
contains.
Objects created in a model or a package are shared between the diagrams of
same type created in the same model or package.
52
Property
Description
Name
Code
Property
Description
Comment
Stereotype
Use parent
namespace
Default diagram
53
Packages (OOM)
generated code, by clicking the Preview tab. The displayed code changes
according to the object language you have selected in your model.
54
Interfaces (OOM)
An interface is similar to a class but it is used to define the specification of a
behavior. It is a collection of operations specifying the externally visible
behavior of a class. It has no implementation of its own.
An interface can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
Component Diagram
An interface includes the signatures of the operations. It specifies only a
limited part of the behavior of a class. A class can implement one or more
interfaces.
A class must implement all the operations in an interface to realize the
interface. The following example shows an interface (Designated) realized
by a class (Employee).
Creating an interface
You can create an interface in any of the following ways:
Select the Interface tool in the diagram Palette
Select Model Interfaces to access the List of Interfaces, and click the
Add a Row tool
Right-click the model or package in the Browser, and select New
Interface
Right-click a class, and select Create Interface from the contextual menu
(this method allows you to inherit all the operations of the class,
including the getter and setter operations, creates a realization link
between the interface and the class, and shows this link in the Realizes
sub-tab of the Dependencies tab of the interface property sheet).
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
55
Interfaces (OOM)
Interface properties
You can modify an objects properties from its property sheet. To open an
interface property sheet, double-click its diagram symbol or its Browser
entry in the Interfaces folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for interfaces.
Interface property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
56
Property
Description
Visibility
Inner to
Type
Generate
Interfaces (OOM)
58
Objects (OOM)
At the conceptual level, an object is an element defined as being part of the
system described. It represents an object that has not yet been instantiated
because the classes are not yet clearly defined at this stage.
If you need to go further with the implementation of your model, the object
that has emerged during analysis will probably turn into an instance of a
defined class. In this case, an object is considered an instance of a class.
Three possible situations can be represented:
When an object is not an instance of a class - it has only a name
When an object is an instance of a class - it has a name and a class
When an object is an instance of a class but is actually representing any
or all instances of a class - it has a class but no name
An object can be created in the following diagrams:
Communication Diagram
Object Diagram
Sequence Diagram
The object shares the same concept in the object, sequence and
communication diagrams. It can either be created in the diagram type you
need, or dragged from a diagram type and dropped into another diagram
type.
Defining multiples
Objects in an object
diagram
In the object diagram, an object instance of a class can display the values of
attributes defined on the class. When the class is deleted, the associated
objects are not deleted.
59
Objects (OOM)
Objects in a
communication diagram
Objects in a sequence
diagram
In the sequence diagram, an object has a lifeline: it is the dashed vertical line
under the object symbol. Time always proceeds down the page. The object
lifeline indicates the period during which an object exists. You cannot
separate an object and its lifeline.
If the object is created or destroyed during the period of time shown on the
diagram, then its lifeline starts or stops at the corresponding point.
Objects appear at the top of the diagram. They exchange messages between
them.
An object that exists when a transaction, or message starts, is shown at the
top of the diagram, above the first message arrow. The lifeline of an object
that still exists when the transaction is over, continues beyond the final
message arrow.
Creating an object
To create an object:
Select the Object tool in the diagram Palette
60
Select Model Objects to access the List of Objects, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New
Object
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Object properties
You can modify an objects properties from its property sheet. To open an
object property sheet, double-click its diagram symbol or its Browser entry
in the Objects folder. The following sections detail the property sheet tabs
that contain the properties most commonly entered for objects.
Object property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
Classifier
Multiple
61
Objects (OOM)
diagram. You can also copy a class or interface and paste it, or paste it as
shortcut, into the object diagram
Why would you link an interface to an object? If you have identified the
interfaces with their methods (the contract is passed directly to the interface,
it shows what the method is doing for the interface) and know the interface
that holds the methods you need (the class being only used as a bridge
towards the interface), but do not know the class of which the object is an
instance, it can be useful to link the object directly to the interface.
object). Attribute values are displayed within the object symbol in the object
diagram, if they are not displayed, you should modify the object display
preferences.
63
Objects (OOM)
64
Property
Description
Class
Class of the object. You can select the Ellipsis button in the
Class column to display the class property sheet
Attribute
Value
Value of the attribute. You can type your own value, or select
the down arrow and choose a value from the list. This list
comes from the List of Values groupbox in the Standard
Checks tab of the attribute property sheet. If you use multivalued attributes, you can use the syntax of your choice to
type the values in this column
Data type
Initial value
Primary identifier
Parts (OOM)
A part allows you to define a discrete area inside a class or a component.
Parts can be connected to other parts or to ports, either directly or via a port
on the outside of the part.
You connect a part to another part by way of an assembly connector. You
connect a part to a port on the outside of a class or component by way of a
delegation connector.
A part can be created in the following diagrams:
Composite Structure Diagram (inside a class)
Component Diagram (inside a component)
You can only create a part within a class or a component. If you attempt to
drag a part outside of its enclosing classifier, the classifier will grow to
continue to enclose it.
Parts in a composite
structure diagram
In the example below, the class TitleImpl2 contains a part called unitTest
Parts in a component
diagram
Creating a part
You can create a part in any of the following ways:
Use the Part tool in the diagram Palette
Open the Parts tab in the property sheet of a class or component, and
click the Add a Row tool
65
Parts (OOM)
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Part properties
You can modify an objects properties from its property sheet. To open a part
property sheet, double-click its diagram symbol or its entry in the Browser.
The following sections detail the property sheet tabs that contain the
properties most commonly entered for parts.
Part property sheet General tab
The General tab contains the following properties:
Property
Description
Parent
Name
Code
Comment
Stereotype
Visibility
Data type
66
Property
Description
Multiplicity
Specifies the number of instances of the part. If the multiplicity is a range of values, it means that the number of parts
can vary at run time.
You can choose between:
* none to unlimited
0..* zero to unlimited
0..1 zero or one
1..* one to unlimited
1..1 exactly one
Composition
67
Ports (OOM)
Ports (OOM)
A port is created on the outside of a classifier and specifies a distinct
interaction point between the classifier and its environment or between the
(behavior of the) classifier and its internal parts.
Ports can be connected to:
a part via a delegation connector, through which requests can be made to
invoke the behavioral features of a classifier
an interface via a require link, through which the port may specify the
services a classifier provides (offers) to its environment as well as the
services that a classifier expects (requires) of its environment.
A port can be created in the following diagrams:
Class Diagram (on a class)
Composite Structure Diagram (on a class, a part, or an interface)
Component Diagram (on a component or a part)
Ports in a class diagram
In the example below, the class TitleImpl2 contains the ports sql and stat,
which are connected by require links to the interfaces java.math.stat2 and
java.sql.connection2:
Ports in a composite
structure diagram
In the example below, the internal structure of the class TitleImpl2 is shown
in more detail, and demonstrates how ports can be used to specify interaction
points between a part and its enclosing classifier:
Ports in a component
diagram
In the example below, the use of ports to connect parts with an enclosing
component is demonstrated:
68
Creating a port
You can create a port in any of the following ways:
Use the Port tool in the diagram Palette
Open the Ports tab in the property sheet of a class, part, or component,
and click the Add a Row tool
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Port properties
You can modify an objects properties from its property sheet. To open a
port property sheet, double-click its diagram symbol or Browser entry. The
following sections detail the property sheet tabs that contain the properties
most commonly entered for ports.
Port property sheet General tab
The General tab contains the following properties:
Property
Description
Parent
Name
Code
Comment
Stereotype
69
Ports (OOM)
Property
Description
Visibility
Data type
Multiplicity
Specifies the number of instances of the port. If the multiplicity is a range of values, it means that the number of ports
can vary at run time.
You can choose between:
* none to unlimited
0..* zero to unlimited
0..1 zero or one
1..* one to unlimited
1..1 exactly one
Redefines
Is Service
Is Behavior
70
1. Select a port and then click Redefine to have it redefined by the child
classifier.
2. Click Close to return to the childs property sheet. The redefined port will
now appear in the list on the Ports tab.
71
Attributes (OOM)
Attributes (OOM)
An attribute is a named property of a class (or an interface) describing its
characteristics.
An attribute can be created for a class or interface in the following diagrams:
Class Diagram
Composite Structure Diagram
Component Diagram
A class or an interface may have none or several attributes. Each object in a
class has the same attributes, but the values of the attributes may be different.
Attribute names within a class must be unique. You can give identical names
to two or more attributes only if they exist in different classes.
In the following example, the class Printer contains two attributes:
printspeed and laser:
Interface attributes
Color
final int RED = 0xFF0000;
final int GREEN = 0x00FF00;
final int BLUE = 0x0000FF;
All these attributes are constants because they are static (independent from
the instances), final (they can not be overloaded), and frozen (their value
cannot be changed).
72
You can use the attributes of other interfaces or classes and add them to the
current interface.
Creating an attribute
You can create an attribute as follows:
Open the Attributes tab in the property sheet of a class, identifier, or
interface, and click the Add a Row tool
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Attribute properties
You can modify an objects properties from its property sheet. To open an
attribute property sheet, double-click its Browser entry in the Attributes
folder. The following sections detail the property sheet tabs that contain the
properties most commonly entered for attributes.
Attribute property sheet General tab
The General tab contains the following properties:
Property
Description
Parent
Name
Code
Comment
Stereotype
73
Attributes (OOM)
Property
Description
Visibility
Data type
Set of instances sharing the same operations, abstract attributes, relationships, and semantics
Multiplicity
Array size
74
Property
Description
Enum class
Static
Derived
Mandatory
Volatile
75
Attributes (OOM)
Property
Description
Property
Description
Changeability
Domain
Primary Identifier
Migrated
from
Persistent
Groupbox for valid generation of CDM or PDM persistent models. Available only for class attributes (it is not
applicable to interface attributes).
For more information on object persistence, see the Managing object persistence during OOM to PDM generation
section in the Generating Other Models from an OOM
chapter.
Code
76
Property
Description
Data type
Length
Precision
Overrides
C# exception
Operation
Description
Getter
Setter
In C#, if you have an attribute with the <<Event>> stereotype, the default
methods are not Getter and Setter but Add and Remove. When you click the
Add Accessors button, the Add and Remove methods are automatically
added.
77
Attributes (OOM)
3. Click the Operations tab to view the newly created at the bottom of the
list of operations. The values are grayed indicating that the names cannot
be modified.
4. Click OK.
2. Click the Add Attributes tool to open the Selection window. This window
contains a list of all the attributes in the model, except those that already
belong to the object.
79
Attributes (OOM)
or
Use the Select All tool to add all the attributes in the list to the object.
4. Click OK to add the selected attributes to the current object.
3. Select an attribute and click Override and then Close. A copy of the
attribute is added to the list of attributes of the child class. It is grayed to
indicate that its properties cannot be modified, and its stereotype is set to
<<Override>>.
4. Click OK.
81
Identifiers (OOM)
Identifiers (OOM)
An identifier is a class attribute, or a combination of class attributes, whose
values uniquely identify each occurrence of the class. It is used during
intermodel generation when you generate a CDM or a PDM into an OOM,
the CDM identifier and the PDM primary or alternate keys become
identifiers in the OOM.
An identifier can be created for a class in the following diagrams:
Class Diagram
Composite Structure Diagram
Each class can have at least one identifier. Among identifiers, the primary
identifier is the main identifier of the class. This identifier corresponds to a
primary key in the PDM.
When you create an identifier, you can attach attributes or business rules to
it. You can also define one or several attributes as being primary identifier of
the class.
For example, the social security number for a class employee is the primary
identifier of this class.
Creating an identifier
You can create an identifier in any of the following ways:
Open the Identifiers tab in the property sheet of a class or interface, and
click the Add a Row tool
Select the Primary Identifier checkbox when you create an attribute
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
v To create a primary identifier when you create the class attributes
1. Double-click a class in the diagram to display its property sheet, and then
click the Attributes tab.
2. Double-click an attribute in the list to display its property sheet, and then
click the Detail tab.
3. Select the Primary Identifier check box and click OK to return to the
Attributes tab of the class property sheet.
82
4. Click the Identifiers tab to view the new identifier in the list.
5. Click OK.
v To define the primary identifier from the list of identifiers
1. Select Model Identifiers to display the list of identifiers.
2. Double-click an identifier in the list to display its property sheet.
3. Select the Primary Identifier check box.
4. Click OK in each of the dialog boxes.
Identifier properties
You can modify an objects properties from its property sheet. To open an
identifier property sheet, double-click its Browser entry in the Identifiers
folder. The following sections detail the property sheet tabs that contain the
properties most commonly entered for identifiers.
Identifier property sheet General tab
The General tab contains the following properties:
83
Identifiers (OOM)
Property
Description
Name
Code
Comment
Class
Primary Identifier
3. Select the check boxes for the attributes you want to add to the identifier.
84
85
Operations (OOM)
Operations (OOM)
An operation is a named specification of a service that can be requested from
any object of a class to affect behavior. It is a specification of a query that an
object may be called to execute.
An operation can be created for a class or interface in the following
diagrams:
Class Diagram
Composite Structure Diagram
Component Diagram
A class may have any number of operations or no operations at all.
In the following example, the class Car, has 3 operations: start engine, brake,
and accelerate.
86
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Creating a user-defined operation
v To create a user-defined operation
1. Double-click a class or interface to display its property sheet, and then
click the Operations tab.
2. Click the Add a Row tool to create a new operation.
3. Click the Properties tool and click Yes in the confirmation box to open
the property sheet of the new operation.
87
Operations (OOM)
Within the context of an inheritance, you can add to a class an operation that
belongs to a parent class, this is called overriding. The operation of the
parent class is said to be overriden when this operation is redefined in a child
class.
The new operation has the same signature (name and parameters) as the
original operation. Once you add an operation to a class, you can only
modify the code implementation of the operation. You cannot modify the
signature of the operation.
v To add an inherited operation to a class
1. Double-click a class that is linked to a parent class in the diagram, and
then click the Operations tab.
2. Click the Inherited button to open the Inherited Operations window. This
window lists all the operations that belong to all the parent classes of the
class.
3. Select an operation, then click Override and Close to copy the operation
to the list of operations of the child class. The copied operation is grayed,
indicating that its properties cannot be modified, and its stereotype is set
to <<Override>>.
4. Click OK in each of the dialog boxes.
Creating a standard operation
You can create the following types of standard operations:
Default Constructor/Destructor Operations - A constructor is a special
type of operation that can be added after creation and initialization of a
class instance. A destructor can be added to de-initialize and destroy a
class instance. You create constructors and destructors from the
Operations tab of the class property sheet.
88
Depending on the object language of the OOM, you can create a Default
constructor (Default means that the operation has no parameter), and a
destructor for a class. For example, in C++ and PowerBuilder, you can
create a constructor and a destructor, whereas in Java, you can only create
a constructor.
If you want to add parameters to a constructor, you have to create a
Default constructor using the following steps, and then add the
parameters of your choice.
Copy Constructor Operations - While a constructor creates and
initializes an instance of a class, a Copy constructor makes a copy of the
attributes of a class instance to initialize another instance.
When you create a Copy constructor, it has the same name as the class. It
has a default parameter, prefixed by the keyword old, which you can
modify, or you can add other parameters. If the class is a parent of
another class, the attribute names within the body of the Copy constructor
operation are the same as those in the parent class. You can define only
one Copy constructor for any given class.
Initializer or Static Initializer Operations (Java only) - The initializer
and static initializer are blocks of code whose purpose is class
initialization. They are executed before the class constructor and are
handled as specific methods prefixed with the names: _INITIALIZER
and _STATIC_INITIALIZER. The names and codes of the initializer and
static initializer methods are read-only, and they do no have any
parameters.
Duplicate Operations - a duplicate operation is an operation that creates
and initializes an instance of a class within the class. When you create a
duplicate operation, it has the name Duplicate which you can modify.
You can define only one duplicate operation for any given class.
Activate/Deactivate Operations (PowerBuilder only)
89
Operations (OOM)
2. Click the Add button at the bottom of the tab, and select the type of
standard operation you want to add. The operation is added to the list.
Some or all of its properties will be dimmed to indicate that they are
uneditable.
3. Add other operations, or click OK to close the property sheet.
Creating an implementation operation
When you create a realization link between a class and an interface, the class
must have an implementation of all the operations of the interface.
When the Auto-Implement Realized Interfaces option is selected in the
model options (Tools Model Options), the operation is automatically
created in the class that implements the interface.
90
91
Operations (OOM)
3. Select an operation from the list, then click Implement and Close. A copy
of the operation is created in the class and is added to the list of
operations. It is grayed, indicating that its name cannot be modified, and
its stereotype is set to <<Implement>>.
4. Click OK.
92
3. Select one or more operations in the list and then click OK to add the
copied operations to the list of operations.
4. Click OK.
Operation properties
You can modify an objects properties from its property sheet. To open an
operation property sheet, double-click its Browser entry in the Operations
folder. The following sections detail the property sheet tabs that contain the
properties most commonly entered for operations.
Operation property sheet General tab
The General tab contains the following properties:
Property
Description
Parent
Name
93
Operations (OOM)
Property
Description
Code
Comment
Stereotype
Return Type
Visibility
Language
event
94
Property
Description
Static
Array
Abstract
Final
Read-only
Web service
method
Influent object
Overrides
Implements
Generic
95
Operations (OOM)
Description
Body
Exceptions
Pre-condition
Post-condition
Specification
You can use the following tool from the Exceptions tab in the
Implementation tab toolbar:
Tool
Description
96
3. Click a sub-tab at the bottom of the edit window and type or modify code.
4. Click OK in each of the dialog boxes.
Operation property sheet Parameters tab
The Parameters tab lists the parameters of your operation. A parameter is a
specification of a variable that can be changed, passed, or returned. It has a
type that indicates the flow of information, a name, and a code.
97
Operations (OOM)
98
Property
Description
Parent
Name
Code
Comment
Data type
Array
Array size
Property
Description
Variable Argument
Parameter
Type
Direction of information flow for the parameter. Indicates what is returned when the parameter is called by
the operation during the execution process. You can
choose from the following:
In - Input parameter passed by value. The final value
may not be modified and information is not available
to the caller
In/Out - Input parameter that may be modified. The
final value may be modified to communicate information to the caller
Out - Output parameter. The final value may be modified to communicate information to the caller
Default value
WSDL data
type
Only available with Web services. Defines the XMLSchema/SOAP type used during invocation of a Web
method (using http or Soap)
99
Operations (OOM)
Property
Description
Parent
Name
Code
Comment
Data type
Array
Array size
Variable Argument
Parameter
Type
Direction of information flow for the parameter. Indicates what is returned when the parameter is called by
the operation during the execution process. You can
choose from the following:
In - Input parameter passed by value. The final value
may not be modified and information is not available
to the caller
In/Out - Input parameter that may be modified. The
final value may be modified to communicate information to the caller
Out - Output parameter. The final value may be modified to communicate information to the caller
100
Property
Description
Default value
WSDL data
type
Only available with Web services. Defines the XMLSchema/SOAP type used during invocation of a Web
method (using http or Soap)
101
Associations (OOM)
Associations (OOM)
An association represents a structural relationship between classes or
between a class and an interface.
An association can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
It is drawn as a solid line between the pair of objects.
In addition to naming the association itself, you can specify a role name for
each end in order to describe the function of a class as viewed by the
opposite class. For example, a person considers the company where he
works as an employer, and the company considers this person as an
employee.
Reflexive association
In the Dependencies tab of the class, you can see two identical occurrences
of the association, this is to indicate that the association is reflexive and
serves as origin and destination for the link.
Aggregation
102
an object of the whole has objects of the part. In the following example, the
family is the whole that can contain children.
You can create an aggregation directly using the Aggregation tool in the
Palette. The aggregation symbol in a diagram is the following:
Composition
You can create a composition directly using the Composition tool in the
Palette. The composition symbol in a diagram is the following:
Creating an association
You can create an association in any of the following ways:
Use the Association, Aggregation, or Composition tool in the diagram
Palette
Select Model Associations to access the List of Associations, and click
the Add a Row tool
Right-click the model or package in the Browser, and select New
Association
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Association properties
You can modify an objects properties from its property sheet. To open an
103
Associations (OOM)
Description
Name
Code
Comment
Stereotype
Class A
Class B
Type
104
Container
Association
Class
Description
Role name
Visibility
105
Associations (OOM)
Property
Description
Multiplicity
The allowable cardinalities of a role are called multiplicity. Multiplicity indicates the maximum and minimum
cardinality that a role can have. You can choose between:
0..1 zero or one
0..* zero to unlimited
1..1 exactly one
1..* one to unlimited
* none to unlimited
An extended attribute exists for each role of an association.
It allows you to choose how the association should be
implemented. They are available in your current object
language, from the Profile\Association\ExtendedAttributes
category, under the roleAContainer and roleBContainer
names. Such extended attributes are pertinent only for
a many multiplicity (represented by *), they provide a
definition for collections of associations.
For more information on the object language, see section
Understanding the object language editor, in chapter Object Languages Reference Guide in the Advanced User
Documentation .
Array size
Changeability
106
Property
Description
Ordering
Initial value
Navigable
Persistent
Volatile
Container type
Implementation class
Migrated attribute
Association implementation
Associations describe structural relationships between classes that become
links between the instances of these classes. These links represent
inter-object navigation that is to say the fact that one instance can retrieve
another instance through the navigable link.
When an association end is navigable, it means you want to be able to
107
Associations (OOM)
retrieve the instance of the class it is linked to, this instance is displayed as a
migrated attribute in the current instance of a class. The rolename of this
end can be used to clarify the structure used to represent the link.
For example, let us consider an association between class Company and
class Person. Navigation is possible in both directions to allow Company to
retrieve a list of employees, and each employee to retrieve his company.
By default, migrated attributes use the class they come from as type.
When the association multiplicity is greater than one, the type is usually an
array of the class, displayed with [] signs. In our example, attribute
employee in class Company is of type Person and has an array of values.
When you instantiate class Company, you will have a list of employees to
store for each company.
public class Company
{
public String Name;
public String Catalog;
public String Address;
public Person[] employee;
Depending on the language you are working with, you may have other ways
to implement migrated attributes. PowerDesigner lets you choose an
implementation in the Detail tab of the association property sheet.
Container type and
implementation class
108
109
Associations (OOM)
Caution
Make sure you do not modify these tags in order to preserve round-trip
engineering.
In Java
In C#
In VB .NET
110
In the following example, the classes Student and Subject are related by an
association exam. However, this association does not specify the date of the
exam. You can create an association class called Exam that will indicate
additional information concerning the association.
111
Associations (OOM)
and the ability to change the attribute order in the list of attributes. The last
feature is especially important in XML.
Regardless of the navigability, the migration creates an attribute and sets its
properties as follows:
Name and code of the attribute: association role if already set, if not the
association name
Data type: code of the classifier linked by the association
Multiplicity: role multiplicity
Visibility: role visibility
Migration rules
Migrating navigable roles You can migrate the navigable role of an association and turn it into an
attribute:
v To migrate navigable roles
1. Right-click the association in the diagram.
112
113
Associations (OOM)
Option
Description
Create associations
Create symbols
for associations
Create internal
links
3. Click OK.
114
Generalizations (OOM)
A generalization is a relationship between a general element (the parent)
and a more specific element (the child). The more specific element is fully
consistent with the general element and contains additional information.
A generalization can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
Component Diagram
Use Case Diagram
You create a generalization relationship when several objects have common
behaviors. You can also create a generalization between a shortcut of an
object and an object but, if the link is oriented, only the parent object can be
the shortcut.
Generalizations in a use
case diagram
Generalizations in a
class or composite
structure diagram
Generalizations (OOM)
Two interfaces
For example, an animal is a more general concept than a cat, a dog or a bird.
Inversely, a cat is a more specific concept than an animal.
Animal is a super class. Cat, Dog and Bird are sub-classes of the super class.
Generalizations in a
component diagram
Creating a generalization
You can create a generalization in any of the following ways:
Use the Generalization tool in the diagram Palette
Select Model Generalizations to access the List of Generalizations, and
click the Add a Row tool
Right-click the model or package in the Browser, and select New
Generalization
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Generalization properties
You can modify an objects properties from its property sheet. To open a
generalization property sheet, double-click its diagram symbol or its
Browser entry in the Generalizations folder. The following sections detail
116
the property sheet tabs that contain the properties most commonly entered
for generalizations.
Generalization property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
Parent
Specifies the parent object. You can use the tools to the
right of the list to create an object, browse the complete tree
of available objects or view the properties of the currently
selected object.
Child
Stereotype
Visibility
117
Generalizations (OOM)
Property
Description
Generate child
class as table
Discriminant
Attribute
If the generalization is created in a use case diagram, you cannot change the
type of objects linked by the generalization. For example, you cannot attach
the dependency coming from a use case to a class, or an interface.
118
Dependencies (OOM)
A dependency is a semantic relationship between two objects, in which a
change to one object (the influent object) may affect the semantics of the
other object (the dependent object).
A dependency can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
Object Diagram
Use Case Diagram
Component Diagram
Deployment Diagram
The dependency relationship indicates that one object in a diagram uses the
services or facilities of another object. You can also define dependencies
between a package and a modeling element.
Dependencies in a class
or composite structure
diagram
Dependencies in an
object diagram
Dependencies in a use
case diagram
Dependencies (OOM)
Dependencies in a
component diagram
Creating a dependency
You can create a dependency in any of the following ways:
Use the Dependency tool in the diagram Palette
Select Model Dependencies to access the List of Dependencies, and
click the Add a Row tool
120
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Dependency properties
You can modify an objects properties from its property sheet. To open a
dependency property sheet, double-click its diagram symbol or its Browser
entry in the Dependencies folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for a
dependencies.
Dependency property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
Influent
Dependent
121
Dependencies (OOM)
Property
Description
Stereotype
122
If the dependency is created in a use case diagram, you cannot change the
objects linked by the dependency. For example, you cannot attach the
dependency coming from a use case to a class or an interface.
123
Realizations (OOM)
Realizations (OOM)
A realization is a relationship between a class or component and an interface.
A realization can be created in the following diagrams:
Class Diagram
Composite Structure Diagram
Component Diagram
In a realization, the class implements the methods specified in the interface.
The interface is called the specification element and the class is called the
implementation element.You can also create a realization between a shortcut
of an interface and a class. Whenever the link is oriented, only the parent
object can be the shortcut.
The arrowhead at one end of the realization always points towards the
interface.
Creating a realization
You can create a realization in any of the following ways:
Use the Realization tool in the diagram Palette
Select Model Realizations to access the List of Realizations, and click
the Add a Row tool
Right-click the model or package in the Browser, and select New
Realizations
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Realization properties
You can modify an objects properties from its property sheet. To open a
realization property sheet, double-click its diagram symbol or its Browser
entry in the Realizations folder. The following sections detail the property
124
sheet tabs that contain the properties most commonly entered for
realizations.
Realization property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
Interface
Class
Stereotype
125
In the example below, require links connect the class TitleImpl with the
interfaces java.math.stat and java.sql.connection. Note how the require link
can proceed from a port or directly from the class
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
126
Property
Description
Name
Code
Comment
Interface
Client
Stereotype
127
Assembly connectors in
a component diagram
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Client
Specifies the part requesting the service. You can use the
tools to the right of the list to create an object, browse the
complete tree of available objects or view the properties of
the currently selected object.
Supplier
Specifies the part providing the service. You can use the
tools to the right of the list to create an object, browse the
complete tree of available objects or view the properties of
the currently selected object.
Stereotype
Interface
129
In the example below a delegation connector connects the supplier port sql
on the outside of the class TitleImp to the client part TitleDataAccess
via a port sql. A second delegation connector connects the supplier part
TitleManager via the port mgr to the port mgr on the outside of the
class TitleImp.
Delegation connectors in
a component diagram
130
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Client
Specifies the part or port requesting the service. You can use
the tools to the right of the list to create an object, browse
the complete tree of available objects or view the properties
of the currently selected object.
Supplier
Specifies the part or port providing the service. You can use
the tools to the right of the list to create an object, browse
the complete tree of available objects or view the properties
of the currently selected object.
Stereotype
131
Annotations (OOM)
Annotations (OOM)
Java 5.0 and the .NET languages (C# 2.0 and VB 2005) provide methods for
adding metadata to code. PowerDesigner provides full support for Java
annotations and .NET custom attributes. For language-specific information,
see the relevant chapter in Part Two of this book.
This metadata can be accessed by post-processing tools or at run-time to
vary to behavior of the system.
3. If the annotation takes parameters, you can enter them directly in the
Annotation Text column or click the ellipsis button to open the
Annotation Editor.
132
4. [optional] Click the Preview tab to see the code that will be generated for
the class, with its declaration preceded by the annotation:
133
Annotations (OOM)
4. [optional] Click the Preview tab to review the code to be generated for the
annotation type:
134
The top panes provide lists of available properties and constructors, which
you can double-click to add them to the bottom, editing pane.
135
The roles of the instance link are duplicated from the roles of the
association. An instance link can therefore be an aggregation or a
composition, exactly like an association of the class diagram. If it is the
case, the composition or aggregation symbol is displayed on the instance
link symbol. The roles of the association are also displayed on the instance
link symbol provided you select the Association Role Names display
preference in the Instance Link category.
Example
136
You can also use shortcuts of associations, however you can only use it if the
model to which the shortcut refers is open in the workspace.
Instance links behavior
Instance links in a
communication diagram
137
The role of the instance link comes from the association. The name of an
instance link comprises the names of both objects at the extremities, plus the
name of the association.
The symbol of the instance link may contain several message symbols
attached to it.
Select Model Instance Links to access the List of Instance Links, and
click the Add a Row tool
Right-click the model or package in the Browser, and select New
Instance Link
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Drag and drop
associations in an object
diagram
You can drag an association from the Browser and drop it into an object
diagram. This creates an instance link and two objects, instances of these
classes or interfaces.
139
Property
Description
Name
Code
Comment
Stereotype
Object A
Object B
Association
+ For more information on the different ways to modify the instance link
properties, see section Modifying object properties in chapter Managing
objects in the General Features Guide .
140
Domains (OOM)
Domains define the set of values for which an attribute is valid. They are
used to enforce consistent handling of data across the system. Applying
domains to attributes makes it easier to standardize data characteristics for
attributes in different classes.
A domain can be created in the following diagrams:
Class Diagram
In an OOM, you can associate the following properties with a domain:
Data type
Check parameters
Business rules
Creating a domain
You can create a domain in any of the following ways:
Select Model Domains to access the List of Domains, and click the
Add a Row tool
Right-click the model or package in the Browser, and select New
Domains
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Domain properties
You can modify an objects properties from its property sheet. To open a
domain property sheet, double-click its Browser entry in the Domains folder.
The following sections detail the property sheet tabs that contain the
properties most commonly entered for domains.
Domain property sheet General tab
The General tab contains the following properties:
Property
Description
Name
141
Domains (OOM)
Property
Description
Code
Comment
Stereotype
Data type
Multiplicity
The tables below indicates the data types for which you can specify:
Fixed length
Maximum length
Decimal precision
Numeric data types
142
Conceptual
data type
Content
Length
Mandatory
Precision
Integer
32-bit integer
Short Integer
16-bit integer
Long Integer
32-bit integer
Byte
256 values
Number
Fixed
Conceptual
data type
Content
Length
Mandatory
Precision
Decimal
Fixed
Float
Fixed
Short Float
Long Float
Money
Fixed
Serial
Fixed
Boolean
Content
Length
Characters
Character strings
Fixed
Variable Characters
Character strings
Maximum
Long Characters
Character strings
Maximum
Character strings
Maximum
Text
Character strings
Maximum
Multibyte
Fixed
Variable Multibyte
Maximum
Content
Date
Time
Timestamp
143
Domains (OOM)
Content
Length
Binary
Binary strings
Maximum
Long Binary
Binary strings
Maximum
Bitmap
Maximum
Image
Images
Maximum
OLE
OLE links
Maximum
Other
Undefined
Description
Persistent
Data Type
Length
Precision
144
Property
Description
Standard
checks
Additional
checks
Rules
You also access a domain property sheet by double-clicking the appropriate domain in the Browser.
3. Type or select domain properties as required in the tabbed pages and click
OK. If the domain is used by one or more attributes, an update
confirmation box asks you if you want to update Data type and Check
parameters for the attributes using the domain.
4. Select the properties you want to update for all attributes using the
domain and click Yes.
145
Description
Standard parameters
Additional check
parameters
SQL expression defining a data constraint using variables instantiated with standard parameter values
Validation rule
Description
Minimum
Maximum
Default
Format
Unit
Standard measure
Uppercase
Lowercase
Cannot Modify
List of Values
Authorized values
146
Description
%MINMAX%
%LISTVAL%
%RULES%
You define additional check parameters for data constraints where standard
check parameters are not sufficient.
v To define additional check parameters
1. Select Model Domains to open the List of Domains.
2. Click a domain from the list, and then click the Properties tool to display
its property sheet.
3. Click the Additional Checks tab, and type your required expressions,
using the variables %MINMAX%, %LISTVAL%, and %RULES%.
147
4. Click OK.
148
CHAPTER 3
This chapter describes how to build a use case diagram. It explains the role
of each element in a use case diagram and how to create and modify them.
Topic:
page
150
153
Actors (OOM)
157
161
149
150
This example shows the use case of a camera. 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.
Tool
Symbol
Description
Actor
Use case
Association
Generalization
Dependency
151
Object-Oriented Model from the Model type list, choose Use Case Diagram
as the first diagram, and click OK.
152
In this example, buy tickets and buy subscriptions are use cases.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
153
Property
Description
Name
Code
Comment
Stereotype
Description
Action Steps
Extension
Points
Provides 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
PreConditions
PostConditions
Each of these sub-tabs contains a text box (RTF or TXT format) which lets
you give a more detailed definition of a use case.
154
To add a class or interface to the list, use one of the following tools:
Tool
Action
Add Objects Opens a dialog box from which you can select any
class or interface currently existing in the model to implement the
use case.
Create a New Class Creates a new class to implement the use case.
The new class is available in the Classes folder of the current model
or package in the Browser for use in other diagrams.
Create a New Interface - Creates a new interface to implement the
use case. The new interface is available in the Interfaces folder of the
current model or package in the Browser for use in other diagrams.
For example, a use case ship product by express mail needs the classes
Shipping, Product, and Billing to perform its task:
155
156
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:
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.
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.
157
Actors (OOM)
Actors in a
Communication Diagram
Actors in a Sequence
Diagram
Creating an actor
To create an actor:
Use the Actor tool in the diagram Palette
Select Model Actors to access the List of Actors, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New Actor
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
158
Actor properties
You can modify an objects properties from its property sheet. To open an
actor property sheet, double-click its diagram symbol or its Browser entry in
the Actors folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for actors.
Actor property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
To add a class or interface to the list, use one of the following tools:
Tool
Action
Add Objects Opens a dialog box from which you can select any
class or interface currently existing in the model to implement the
actor.
Create a New Class Creates a new class to implement the actor.
The new class is available in the Classes folder of the current model
or package in the Browser for use in other diagrams.
Create a New Interface - Creates a new interface to implement the
actor. The new interface is available in the Interfaces folder of the
current model or package in the Browser for use in other diagrams.
For example, an actor Car needs the classes Engine and Motorway to
perform its task. They are shown as related to the actor in the following
159
Actors (OOM)
figure:
Reusing actors
The 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.
160
+ If the orientation of the association is not displayed, you can modify the
association display preferences.
Example
161
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Stereotype
Orientation
Source
162
Property
Description
Destination
163
CHAPTER 4
Contents
page
167
168
172
177
180
184
Messages (OOM)
186
Activations (OOM)
203
207
210
Activities (OOM)
214
Flows (OOM)
230
Transitions (OOM)
234
Starts (OOM)
238
Ends (OOM)
240
Decisions (OOM)
242
Synchronizations (OOM)
246
249
257
States (OOM)
259
165
Topic:
166
page
Events (OOM)
266
Actions (OOM)
270
274
167
168
to identify the classes that will instantiate them. After having identified the
classes, you can then deduce the associations between them from the
instance links between the objects.
The major difficulty with this approach consists in identifying the correct
objects to transcribe the action steps of the use case. An extension to UML,
Robustness Analysis can make this process easier. This method
recommends separating objects into three types:
Boundary objects are used by actors when communicating with the
system; they can be windows, screens, dialog boxes or menus
Entity objects represent stored data like a database, database tables, or
any kind of transient object such as a search result
Control objects are used to control boundary and entity objects, and
represent the transfer of information
PowerDesigner supports the Robustness Analysis extension through an
extended model definition. For more information, see the Using profiles: a
case study in the Managing Profiles chapter of the PowerDesigner
Advanced User Documentation.
Analyzing a class
diagram
169
Tool
Symbol
Description
Actor
An external person, process or something interacting with a system, subsystem or class. See the Actors
section in the Building Use Case
Diagrams chapter.
Object
Instance link
Message
diagram, and creates instance links between the objects that communicate
using messages. The conversion also updates any message sequence
numbers, based upon the relative position of messages on the timeline.
Note that when you create a communication diagram from a sequence
diagram, the two do not remain synchronized changes made in one
diagram will not be reflected in the other.
v To create a communication diagram from a sequence diagram
1. Right-click in the background of the sequence diagram and select Create
Default Communication Diagram in the contextual menu.
or
Select Tools Create Default Communication Diagram.
171
172
Example
In the example above, the Client actor places an order. The Place Order
message creates an Order object. An interaction fragment handles various
possibilities for checking the order. The Account object and Manager actor
may interact with the order depending on its size. Once the Confirm Order
message is sent, the Process Order interaction is initiated. This interaction is
stored in another sequence diagram, and is represented here by an interaction
reference.
Analyzing a use case
173
then deduce the associations between them from the messages passing
between the objects.
Analyzing a class
diagram
The Auto-layout, Align and Group Symbols features are not available in
the sequence diagram.
Merging sequence diagrams
When you use the Merge Models feature to merge sequence diagrams,
the symbols of all elements in the sequence diagram are merged without
comparison. You can either accept all modifications on all symbols or no
modifications at all.
174
or
Select Tools Create Default Sequence Diagram.
Tool
Symbol
Description
Actor
An external person, process or something interacting with a system, subsystem or class. See the Actors
section in the Building Use Case
Diagrams chapter.
Object
Activation
Interaction Reference
Interaction
Fragment
175
Object
176
Tool
Symbol
Description
Message
Self Message
Procedure Call
Message
Return Message
Self Return
Message
177
Analyzing a business
process
Symbol
Description
Start
Activity
Composite activity
178
Tool
N/A
Object node
Organization
unit
Flow
Path of the control flow between activities. See Flows (OOM) on page 230.
Decision
Object
Tool
Symbol
Description
Synchronization
End
179
180
181
By default new diagrams are created with an empty value in the Default
Classifier list, except sub-statechart diagrams that automatically share the
same Classifier value defined on the parent decomposed state. The Default
Classifier value is an optional value in the statechart diagram.
For general information about diagram properties, see the Defining a
diagram section of the Managing Models chapter in the General Features
Guide .
Tool
Symbol
Description
Start
State
Action
N/A
N/A
Event
N/A
N/A
Transition
Path on which the control flow moves between states. See Transitions (OOM)
on page 234.
Junction
point
End
182
183
184
Tool
Symbol
Description
Start
Interaction activity
Flow
Decision
Decision the flow has to take when several paths are possible. See Decisions
(OOM) on page 242.
Synchronization
End
185
Messages (OOM)
Messages (OOM)
A message is a communication between objects. The receipt of a message
will normally have an outcome.
A message can be created in the following diagrams:
Communication Diagram
Sequence Diagram
Objects can cooperate by using several kinds of requests (send a signal,
invoke an operation, create an object, delete an existing object, etc.).
Sending a signal is used to trigger a reaction from the receiver in an
asynchronous way and without a reply. Invoking an operation will apply an
operation to an object in a synchronous or asynchronous mode, and may
require a reply from the receiver. All these requests constitute messages.
They correspond to stimulus in the UML language.
A message has a sender, a receiver, and an action. The sender is the object
or actor that sends the message. The receiver is the object or actor that
receives the message. The action is executed on the receiver. You can also
create recursive messages, where the same object is the sender and receiver.
The message symbol is an arrow showing its direction, and can also display
the following information:
A sequence number indicating the order in which messages are
exchanged (see Sequence numbers on page 199)
The message name (or the name of the associated operation)
The condition
The return value
The argument
Reusing Messages
186
Any change on the Action or Control Flow value of the message is reflected
in all diagrams. However, if the change you want to perform is not valid, the
change will not be possible. For example, you are not allowed to move a
Create message if a Create message already exists between the sender and
the receiver.
Messages in a
communication diagram
Messages in a sequence A message is shown as a horizontal solid arrow from the lifeline of one
diagram
object or actor, to the lifeline of another. The arrow is labeled with the name
of the message. You can also define a control flow type that represents both
the relationship between an action and its preceding and succeeding actions,
and the waiting semantics between them.
If you need to fully describe, or put a label on a message, you can write a
note using the Note tool, and position the note close to the message.
187
Messages (OOM)
Creating a Message
You can create a message in any of the following ways:
Use the Message tool (or, in a sequence diagram, the Self Message,
Procedure Call Message, or Self Call Message tool) in the diagram
Palette
Select Model Messages to access the List of Messages, and click the
Add a Row tool
Right-click the model or package in the Browser, and select New
Message
Open the property sheet of an instance link (in a communication
diagram), click the Messages tab, and click the Create a New Message
tool.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Message properties
You can modify an objects properties from its property sheet. To open a
message property sheet, double-click its diagram symbol or its Browser
entry in the Messages folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for use cases.
Message property sheet General tab
A message has the following general properties:
188
Property
Description
Name
Code
Comment
Sequence number
Stereotype
Sender
Object the message starts from. You can use the tools
to the right of the list to create an object, browse the
complete tree of available objects or view the properties
of the currently selected object.
Receiver
Object the message ends on. You can use the tools to the
right of the list to create an object, browse the complete
tree of available objects or view the properties of the
currently selected object. Click the Reverse direction
tool beside this box to invert the sender and receiver.
You cannot invert the direction of a message when the
message is a Create or Destroy message.
You can right-click a message in the diagram and select Reverse from the
contextual menu to invert its direction.
Message property sheet Detail tab
The Detail tab in the message property sheet includes the following
properties:
189
Messages (OOM)
Property
Description
Action
Control flow
190
Property
Description
Operation
Return value
Predecessor
list
Condition
191
Messages (OOM)
Property
Description
Begin time
End time
Support delay
Control flow
You can combine message control flows and message actions according to
the following table:
Control flow
Asynchronous
192
Symbol
No action
Create
Destroy
Self-Destroy
Control flow
Symbol
No action
Create
Destroy
Self-Destroy
Procedure Call
Return
Undefined
4 = allowed
= not allowed
Accessing Action and Control flow values
You can access the Action and Control flow values of a message by right
clicking the message symbol in the diagram, and selecting Action/Control
flow from the contextual menu.
193
Messages (OOM)
3. Release the mouse button on the object symbol of the receiver (and not
on its lifeline).
If the message is the first message to be received by the receiver object,
the receiver object symbol moves down to line up with the create
message.
4. Select Destroy from the Action list in the Detail tab (this action is not
available if the message is not the last message on the receiver lifeline).
5. Click OK. An X is placed at the intersection point between the Destroy
message arrow and the receiver object lifeline.
Messages (OOM)
The Create and Self-Destroy actions, and the Support delay option are not
available with a recursive message.
When you create Undefined or Return recursive messages from the tool
palette, the control flow value is already selected:
Message type
Symbol
You can also create an Undefined recursive message and change the control
flow value afterwards.
Example
196
197
Messages (OOM)
198
Sequence numbers
Sequence numbers can be assigned to messages in both communication and
sequence diagrams, but they are most important in communication diagrams.
When you create a message in a communication diagram, the default value
of the sequence number is calculated with regards to the most recently
created or modified message. The first sequence number created is 1.
A succession of sequence numbers is built from the most recent sequence
199
Messages (OOM)
Example 2
200
Example 3
When you change sequence number 2 and place it in fifth position, sequence
number 2 becomes sequence number 5: all numbers between 2 and 5 are
modified as follows:
Example 4
You can use the Undo feature whenever needed while manipulating these
elements within communication diagrams.
Inserting sequence numbers
When you insert a new message with a new sequence number in an existing
communication diagram, the sequence numbers are recalculated with respect
201
Messages (OOM)
to the following rule: for each number after the insertion, all numbers are
incremented by 1.
In the same manner, a parent changes its children. For example, the number
is incremented by 1 for numbers like 1.1, 1.2, 1.3 as follows: 1.1 + 1 = 1.2.
The syntax of sequence numbers currently used in the diagram is respected:
that means that the number is incremented by 1 regardless of the syntax (1,
2, 3. . . or 1.1, 1.2, 1.3. . . ).
Increasing sequence numbers in a communication diagram
You can increment a sequence number using the following methods:
Right-click the message in the diagram and select Increase Number from
the contextual menu.
or
Select the message in the diagram and press CTRL + press the numpad
plus sign (+) to increment the number by 1.
Decreasing sequence numbers in a communication diagram
You can decrease a sequence number using the following methods:
Right-click the message in the diagram and select Decrease Number from
the contextual menu.
or
Select the sequence number in the diagram and press CTRL + press the
numpad minus sign (-) to decrease the number by 1.
202
Activations (OOM)
Activations are optional symbols that represent the time required for an
action to be performed. They are created on the lifeline of an object. They
are purely symbols and do not have property sheets.
An activation can be created in the following diagrams:
Sequence Diagram
In a communication diagram, messages that are passed during the period
represented by an activation are given sub-numbers. Thus an activation
created by message 1, may give rise to messages 1.1 and 1.2.
You can attach or detach a message to an activation. You can also move,
resize, and cause the activation to overlap other activations.
Creating an activation
You can create an activation when you create a Procedure Call message or
afterwards for any type of message. A Procedure Call generally starts an
activation, that is why the message is automatically attached to an activation.
v To create an activation at creation of the message
1. Select the Procedure Call Message tool in the Palette.
2. Click the lifeline of the sender object or actor and, while holding down
the mouse button, drag the cursor towards the receiver object.
3. Release the mouse button on the object symbol of the receiver.
The message is created along with activations on the lifelines of both the
sender and receiver (note that activations are not created on the lifelines
of actors).
v To create an activation from a diagram
1. Select the Activation tool in the Palette.
2. Click the lifeline of an object to create an activation symbol at the click
position. If you create the activation on top of an existing message, it is
automatically attached to the activation.
Activations (OOM)
at the endpoints of the message arrow (if attachment symbols are not
displayed, select Tools Display Preferences, and select the Activation
Attachment display preference in the Message category).
You can attach an existing message that touches an activation but which does
not display an activation symbol, by dragging the message inside the
activation, while holding the CTRL key down.
When a message is attached to an activation, you cannot move it outside the
limits of the activation symbol as shown below:
Overlapping activations
An activation can overlap other existing activations.
204
For example, you may want an activation to overlap another one to represent
an action in a loop. The action is done repeatedly until it reaches its goal,
this loop can start and finish at the same time another activation is
representing another action.
You can make activations overlap this way to show concurrent activities.
Moving an activation
If you move an activation with a message attached to it, the message does
not move. Thus, it is possible to move the activation up and down until its
top or bottom reaches the message level.:
If you move the endpoint of a message with Support Delay, the inclination
angle of the message is preserved as shown below:
205
Activations (OOM)
Resizing an activation
You may want to resize an activation by pulling the top or bottom of the
activation symbol. This will resize the activation vertically.
When you resize an activation, the following rules apply:
A Procedure Call message is always attached to the top of the activation
on the receiver lifeline. The Procedure Call message stays at the top of
the activation if the activation is moved up, or resized upwards.
A Return message is always attached to the bottom of the activation on
the sender lifeline. The Return message stays at the bottom of the
activation if the activation is moved down.
Messages that are covered by the activation after resizing are not
automatically attached to the activation.
To change the activation of a message, press CTRL and CLICK to select the
begin or endpoint of the message and drag it onto another activation.
206
In the example below, the user must log in before passing a request to the
account page of a website. As the log in process will form a part of many
interactions with the site, it has been abstracted to another sequence diagram
called Log In, and is represented here by an interaction reference.
attached to that lifeline, or click and hold while drawing a box that will
overlap and attach to several lifelines.
The Select a sequence diagram dialog box opens to allow you to specify
the sequence diagram to which the reference refers. Select an existing or
new diagram and click OK.
Drag another sequence diagram from the browser and drop it into the
present sequence diagram.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
208
Property
Description
Referenced
Diagram
Stereotype
Arguments
Return value
209
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
210
property sheet tabs that contain the properties most commonly entered for
interaction fragments.
Interaction fragment property sheet General tab
The General Tab contains the following properties:
Property
Description
Operator
Stereotype
211
Property
Description
Condition
You can move interaction fragments, resize them, and generally manipulate
them freely. When you cause the symbol to overlap an object lifeline, it
attaches to it automatically, and this attachment is represented by a small
bump on the top edge of the symbol where it meets the lifeline. If you drag
or resize the symbol away from a lifeline, it detaches automatically.
If you move an object that is attached to an interaction fragment, the symbol
resizes itself automatically to remain attached to the object lifeline.
You can manually control whether object lifelines are attached to an
interaction fragment that passes over them by clicking the attachment point.
Moving messages
212
When a fragment is split into two or more regions, you can move messages
freely between regions. However, you cannot move the line that divides two
regions over a message. If you delete a region, then the space that it occupied
and any messages it contained will be merged with the region above.
Note that an interaction fragment cannot be copied or re-used in another
diagram.
213
Activities (OOM)
Activities (OOM)
An activity is the invocation of a manual or automated action, such as send
a mail, or increment a counter. When the activity gains control, it
performs its action and then, depending on the result of the action, the
transition (control flow) is passed to another activity.
An activity can be created in the following diagrams:
Activity Diagram
PowerDesigners support for UML 2 allows you a great deal of flexibility in
the level of detail you provide in your activity diagrams. You can simply link
activities together to show the high-level control flow, or refine your model
by specifying the:
parameters that are passed between the activities (see Specifying activity
parameters on page 218)
action type of the activity and associate it with other model objects (see
Specifying action types on page 220)
214
215
Activities (OOM)
PowerDesigner Objects
ActionState
Activity
SubactivityState
Composite activity
Activity Graph
Composite activity
Creating an activity
You can create an activity in any of the following ways:
Use the Activity tool in the diagram Palette
Select Model Activities to access the List of Activities, and click the
Add a Row tool
Right-click the model, package, or decomposed activity in the Browser,
and select New Activity
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Activity properties
You can modify an objects properties from its property sheet. To open an
activity property sheet, double-click its diagram symbol or its Browser entry
in the Activities folder. The following sections detail the property sheet tabs
that contain the properties most commonly entered for activities.
Activity property sheet General tab
The General Tab contains the following properties:
216
Property
Description
Name
Property
Description
Code
Comment
Stereotype
Organization
unit
Composite
status
Specifies whether the activity is decomposed into subactivities. You can choose between:
Atomic Activity (default) The activity does not contain
sub-activities
Decomposed Activity the activity can contain subactivities. A Sub-Activities tab is displayed in the property sheet to list these sub-activities, and a sub-diagram is
created below the activity in the Browser to display them.
If you revert the activity from Decomposed to Atomic status,
then any sub-activities that you have created will be deleted.
217
Activities (OOM)
Property
Description
Action type
[action object]
Pre-Conditions
/ Actions / PostConditions
Duration
Timeout
218
Description
Name
Code
Comment
Stereotype
Data type
State
219
Activities (OOM)
2. Next, I open its property sheet, click the Action tab, and select Call from
the Action type list. The Operation field appears:
221
Activities (OOM)
3. I click the Create tool to the right of the new field to open a wizard to
choose an operation:
222
5. I specify a name for my class and for the operation that I want to create,
and then click Next:
6. I create two input and one output parameter for my operation, and then
click Finish. The property sheet of the new operation opens to allow me
to further specify the operation. When I am finished, I click OK to return
to the Activity property sheet and click the Input Parameters tab to view
the parameters I have created:
223
Activities (OOM)
My activity now displays its two input and one output parameter (the
target parameter is hidden by default). The class and operation that I have
created are available in the Browser for further use.
Example: Reading and writing variables
Variables hold temporary values that can be passed between activities. You
can create and access variables using the Write Variable and Read Variables
action types
v To create a variable
1. Open the property sheet of an activity and click the Action tab.
2. Select an action type of Write Variable, and then click the Create tool to
the right of the variable field to create a new variable and open its
property sheet.
3. Specify the name and other properties of the variable and click OK to
return to the activity property sheet.
224
Description
Name
Code
Comment
Stereotype
Data type
225
Activities (OOM)
Property
Description
Multiplicity
following ways:
Press CTRL and double-click the activity symbol (this will open the
sub-activity directly)
Open the property sheet of the activity and, on the General tab, select the
Decomposed Activity radio button
Right-click the activity and select Decompose Activity from the
contextual menu
When you create a decomposed activity, a sub-activity diagram is added
below its entry in the browser:
The decomposed activity will be empty at first. Any objects that you create
in the sub-activity diagram are listed in the Browser under the decomposed
activity.
Converting an activity diagram to a decomposed activity
You can convert an activity diagram to a decomposed activity using the
Convert Diagram to Activity wizard. The conversion option is only available
once objects have been created in the diagram. By converting a diagram to a
decomposed activity, you can then use the decomposed activity in another
activity diagram.
v To convert an activity diagram to a decomposed activity using
the Convert Diagram to Activity wizard
1. Right-click the diagram node in the Browser and select Convert to
Composite Activity from the contextual menu.
or
Right-click the diagram background and select Diagram Convert to
Composite Activity from the contextual menu.
or
227
Activities (OOM)
2. Specify a name and a code in the Convert Diagram to Activity page, and
then click Next to open the Selecting Objects to Move page.
3. Select the activities that you want to move to the new decomposed
activity diagram. Activities that you select will be moved in the Browser
to under the new decomposed activity. Those that you do not select will
remain in their present positions in the Browser and will be represented in
the new sub-activity diagram as shortcuts.
4. Click Finish to exit the wizard. The new decomposed activity and its
sub-activity diagram will be created, and any objects selected to be
moved will now appear beneath the decomposed object in the Browser
Working with sub-activity diagrams
You can open the sub-activity diagram of a decomposed activity in any of
the following ways:
Press CTRL and double-click on the decomposed activity symbol
Right-click the diagram background and select Diagram Go Up One
Level from the contextual menu. If several diagrams are open in the
workspace, you are requested to select the desired diagram.
Double-click the appropriate diagram entry in the Browser
You can move from a sub-activity diagram to another diagram in any of the
following ways:
Press CTRL + U to go to the models default diagram
228
Right-click the activity and select Open Diagram from the contextual
menu
Double-click the sub-activity diagram entry under the decomposed
activity in the Browser
Setting a diagram as default diagram
You can add objects to a sub-activity diagram in the same way as you add
them to an activity diagram. Any activities that you add to a sub-activity
diagram will be a part of its parent decomposed activity and will be listed
under the decomposed activity in the Browser.
Find in Browser
You can locate any object or any diagram in the Browser tree view from
the current diagram window. To do so, right-click the object symbol, or the
diagram background and select Edit Find in Browser.
Composite view
229
Flows (OOM)
Flows (OOM)
A flow is a link between two activities, the route the control flow transits on
between them. The routing of the control flow is made using guard
conditions defined on flows. If the condition is true, the control is passed to
the next element.
A flow can be created in the following diagrams:
Activity Diagram
Interaction Overview Diagram
A flow between an activity and an object node indicates that the execution of
the activity puts an object in a specific state. When a specific event occurs or
when specific conditions are satisfied, the control flow passes from the
activity to the object node. A flow from an object node to an activity means
that the activity uses this specific state in its execution. In both cases, the
flow is represented as a simple arrow.
You can draw a flow from and to the following objects:
From\to
Start
Activity
OS*
Decision
Fork
Join
End
Start
Activity
OS*
Decision
Fork
Join
End
4 = allowed
= not allowed *OS = Object State
A flow can link shortcuts. A flow accepts shortcuts on both extremities to
prevent it from being automatically moved when an activity is to be moved.
In this case, the activity is moved and leaves a shortcut, but contrary to the
other links, the flow is not moved. Shortcuts of flows do not exist, and flows
remain in place in all cases.
The following rules apply:
230
When flows are compared and merged by the Merge Model feature, they
are matched by trigger event first, and then by their calculated name. When
two flows match, the trigger actions automatically match because there
cannot be more than one trigger action.
Creating a flow
You can create a flow in any of the following ways:
Use the Flow tool in the diagram Palette
Select Model Flows to access the List of Flows, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New Flow
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Flow properties
You can modify an objects properties from its property sheet. To open a
flow property sheet, double-click its diagram symbol or its Browser entry in
the Flows folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for flows.
Flow property sheet General tab
The General tab contains the following properties:
Property
Description
Name
Code
Comment
231
Flows (OOM)
Property
Description
Source
Where the flow starts from. You can use the tools to the right of
the list to create an object, browse the complete tree of available
objects or view the properties of the currently selected object
Destination
Where the flow goes to. You can use the tools to the right of the
list to create an object, browse the complete tree of available
objects or view the properties of the currently selected object
Stereotype
Flow type
Weight
Description
Alias
Condition
(text box)
tokens. For example, it could extract a single attribute value from an input
object.
233
Transitions (OOM)
Transitions (OOM)
A transition is an oriented link between states, which indicates that an
element in one state can enter another state when an event occurs (and,
optionally, if a guard condition is satisfied). The expression commonly used
in this case is that a transition is fired.
A transition can be created in the following diagrams:
Statechart Diagram
The statechart diagram transition is quite similar to the flow in the activity
diagram, with the addition of a few properties:
A trigger event: it is the event that triggers the transition (when you copy
a transition, the trigger event is also copied)
A trigger action: it specifies the action to execute when the transition is
triggered
The activity diagram is a simplification of the statechart diagram in which
the states have only one action and the transition has a triggered event
corresponding to the end of the action.
The transition link is represented as a simple arrow. The associated event,
the condition and the action to execute are displayed above the symbol.
Start
State
Junction point
End
Start
State
Junction point
End
4 = allowed
= not allowed
The following rules apply:
Reflexive transitions only exist on states
234
When transitions are compared and merged by the Merge Model feature,
they are matched by trigger event first, and then by their calculated name.
When two transitions match, the trigger actions automatically match
because there cannot be more than one trigger action.
Creating a transition
You can create a transition in any of the following ways:
Use the Transition tool in the diagram Palette
Select Model Transitions to access the List of Transitions, and click the
Add a Row tool
Right-click the model or package in the Browser, and select New
Transition
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Transition properties
You can modify an objects properties from its property sheet. To open an
transition property sheet, double-click its diagram symbol or its Browser
entry in the Transitions folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for transitions.
Transition property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
235
Transitions (OOM)
Property
Description
Comment
Source
Where the transition starts from. You can use the tools
to the right of the list to create an object, browse the
complete tree of available objects or view the properties of
the currently selected object
Destination
Where the transition ends on. You can use the tools to the
right of the list to create an object, browse the complete tree
of available objects or view the properties of the currently
selected object
Stereotype
Flow type
Description
Alias
Condition
(text box)
236
Property
Description
Trigger event
Event arguments
Trigger action
Operation
Read-only list that lists operations of the classifier associated with the state that is the source of the transition. It
allows you to specify the action implementation using an
operation. It is grayed and empty when the classifier is
not a class
Operation arguments
237
Starts (OOM)
Starts (OOM)
A start is the starting point of the whole process represented in an activity or
statechart diagram. Its symbol is a solid circle as shown below:
The start is compared and merged in the Merge Model feature. Since starts
should be unique in decomposed states, the Merge Model feature checks
that there is no additional start in a decomposed state.
Creating a start
You can create a start in any of the following ways:
Use the Start tool in the diagram Palette
Select Model Starts to access the List of Starts, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New Start
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Start properties
You can modify an objects properties from its property sheet. To open a
start property sheet, double-click its diagram symbol or its Browser entry in
the Start folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for starts.
Start property sheet General tab
The General Tab contains the following properties:
238
Property
Description
Name
Code
Comment
Stereotype
239
Ends (OOM)
Ends (OOM)
An end is the termination point of an activity or state. Its symbol is a solid
ball inside a circle (bulls eye).
An end can be created in the following diagrams:
Activity Diagram
Statechart Diagram
Activity Overview Diagram
You can have several ends in the same diagram if you want to show
divergent end cases, such as errors scenarios for example:
You can also have no end if you want to show an endless process between
two activities.
You are not allowed to use shortcuts of ends, but graphical synonyms are
permitted.
You should not use the same end in more than one diagram.
Creating an end
You can create an end in any of the following ways:
Use the End tool in the diagram Palette
Select Model Ends to access the List of Ends, and click the Add a Row
tool
Right-click the model or package in the Browser, and select New End
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
End properties
You can modify an objects properties from its property sheet. To open an
240
end property sheet, double-click its diagram symbol or its Browser entry in
the Ends folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for ends.
End property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
241
Decisions (OOM)
Decisions (OOM)
A decision specifies which alternate path has to be taken when several
transition paths are possible. Its symbol is a diamond shape:
242
Creating a decision
You can create a decision in any of the following ways:
Use the Decision tool in the diagram Palette
Select Model Decisions to access the List of Decisions, and click the
Add a Row tool
Right-click the model or package in the Browser, and select New
Decision
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Decision properties
You can modify an objects properties from its property sheet. To open a
decision property sheet, double-click its diagram symbol or its Browser
entry in the Decisions folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for decisions.
Decision property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
243
Decisions (OOM)
Property
Description
Type
Description
Alias
Condition
(text box)
Conditional branches
A conditional branch joins multiple transitions. It is a place within an
activity diagram where a specific event leads to more than one possible
outcome, each of which has an associated guard condition or the keyword
ELSE.
244
Symbol
Factorizing conditions
Example
Use the Condition tab in the decision property sheet to write the following
condition: Total * NB + VAT > 10.000. Then use the Condition tab in both
transitions property sheet: enter True in one and False in the other.
Merges
A merge is a scenario within an activity diagram where two or more
alternate control paths come together, it represents the merge of several
potential transitions into a common path.
Symbol
245
Synchronizations (OOM)
Synchronizations (OOM)
A synchronization is an object that enables the splitting or synchronization
of control between two or more concurrent actions.
Synchronizations are represented as horizontal or vertical lines. You can
change the orientation of the symbol by right-clicking it and selecting
Change to Vertical or Change to Horizontal from the contextual menu.
Join merges multiple input flows into a single output flow. The
activities associated with each of the paths above the join symbol are
parallel. In a join, concurrent transitions synchronize. Each transition
waits until all input flows reach the join before continuing; the first
executed transition waiting for the last one to complete. After the join,
only one transition continues below the join.
Creating a synchronization
You can create a synchronization in any of the following ways:
246
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Synchronization properties
You can modify an objects properties from its property sheet. To open a
synchronization property sheet, double-click its diagram symbol or its
Browser entry in the Synchronizations folder. The following sections detail
the property sheet tabs that contain the properties most commonly entered
for synchronizations.
Synchronization property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
Timeout
247
Synchronizations (OOM)
Property
Description
Type
248
You can also display swimlane symbols by right clicking in the activity
diagram and select Enable Swimlane Mode from the contextual menu, or
conversely by right clicking in the activity diagram and select Disable
Swimlane Mode from the contextual menu.
You can create internal and external shortcuts of organization unit.
Using models from version 9
If you use a model that has been created in version 9, use the Tools
Display Preferences General command and select the Organization Unit
Swimlane check box to display the organization units.
249
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
250
Property
Description
Name
Code
Property
Description
Comment
Stereotype
Parent organization
or
251
Click the Activity tool in the palette and click in the required swimlane.
or
Select an activity symbol in the diagram, press the ALT key and drop the
symbol into the required swimlane.
The organization unit name is displayed in the Organization Unit list and
the activity is attached to the swimlane.
Pressing the ALT key
You can easily attach an existing activity to a swimlane by pressing the ALT
key while dragging the activity to the swimlane.
252
or
Select <None> in the Organization Unit list in the activity property
sheet.
Managing swimlanes
All symbols displayed in the diagram and associated with an organization
unit must be drawn in the corresponding swimlane. Activity symbols are
slightly different because you can attach activities to a swimlane, thus if you
change the attachment of an activity, its symbol moves to the appropriate
swimlane.
To select a swimlane, position the cursor above the organization unit symbol
until you see a vertical arrow pointing to the frame, then click the left mouse
button.
253
There can only be one whole set of swimlanes per diagram. To select the
entire set of swimlanes, click in the header of one of the swimlanes.
254
Diagram
What happens. . .
Different
Same
If you move attached activities inside a swimlane, the width or height of the
swimlane varies to include all attached activities.
When you move or copy an entire set of swimlanes and paste it into a
different diagram, the symbols that exist inside the swimlanes are not copied.
Auto-Layout function
255
When you change the width or height of an individual swimlane, all activity
symbols attached to the swimlane keep their position.
You can also resize the entire set of swimlanes by selecting one of the
handles around the whole set of swimlanes and drag it to any direction.
256
257
Drag and drop a classifier from the Browser onto an activity diagram. The
new object node will be linked to and display the name of the classifier.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Stereotype
Data type
Specifies the data type of the object node. You can use the
tools to the right of the list to create a classifier, browse the
complete tree of available classifiers or view the properties
of the currently selected classifier.
State
Specifies the state of the object node. You can type the
name of a state here or, if a classifier has been specified as
the data type, select one of its states from the list. You can
use the tools to the right of the list to create a state, browse
the complete tree of available states or view the properties
of the currently selected state.
258
States (OOM)
A state represents a situation during the life of a classifier that is usually
specified by conditions. It can also be defined as the situation of a classifier
waiting for events. Stability and duration are two characteristics of a state.
A state can be created in the following diagrams:
Statechart Diagram
A state can be atomic or decomposed:
An atomic state does not contain sub-states, and has the following
symbol:
Creating a state
You can create a state in any of the following ways:
259
States (OOM)
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
State properties
You can modify an objects properties from its property sheet. To open a
state property sheet, double-click its diagram symbol or its Browser entry in
the States folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for states.
State property sheet General tab
The General Tab contains the following properties:
260
Property
Description
Name
Code
Comment
Stereotype
Classifier
Composite status
If you select the Decomposed state option, the state becomes a decomposed state. If you select the Atomic state
option, the state becomes an atomic state, and all its child
objects are deleted
You can open the Actions tab by right clicking the state symbol in the
diagram, and selecting Actions from the contextual menu.
261
States (OOM)
262
The decomposed state will be empty at first. Any objects that you create in
the sub-state diagram are listed in the Browser under the decomposed state.
Converting a statechart diagram to a decomposed state
You can convert a statechart diagram to a decomposed state using the
Convert Diagram to State wizard. The conversion option is only available
once objects have been created in the diagram. By converting a diagram to a
decomposed state, you can then use the decomposed state in another
statechart diagram.
v To convert a statechart diagram to a decomposed state using the
Convert Diagram to State wizard
1. Right-click the diagram node in the Browser and select Convert to
Decomposed State from the contextual menu.
or
Right-click the diagram background and select Diagram Convert to
Decomposed State from the contextual menu.
or
Select Tools Convert to Decomposed State.
2. Specify a name and a code in the Convert Diagram to State page, and
then click Next to open the Selecting Objects to Move page.
3. Select the states that you want to move to the new decomposed state
diagram. States that you select will be moved in the Browser to under the
new decomposed state. Those that you do not select will remain in their
263
States (OOM)
You can open the sub-state diagram of a decomposed state in any of the
following ways:
Press CTRL and double-click on the decomposed state symbol
Right-click the diagram background and select Diagram Go Up One
Level from the contextual menu. If several diagrams are open in the
workspace, you are requested to select the desired diagram.
Double-click the appropriate diagram entry in the Browser
You can move from a sub-state diagram to another diagram in any of the
following ways:
Press CTRL + U to go to the models default diagram
Right-click the state and select Open Diagram from the contextual menu
Double-click the sub-state diagram entry under the decomposed state in
the Browser
Setting a diagram as default diagram
You can add objects to a sub-state diagram in the same way as you add them
to any statechart diagram. Any states that you add to a sub-state diagram
will be a part of its parent decomposed state and will be listed under the
decomposed state in the Browser.
Find in Browser
You can locate any object or any diagram in the Browser tree view from
the current diagram window. To do so, right-click the object symbol, or the
diagram background and select Edit Find in Browser.
Composite view
264
Composite View from the contextual menu. You may need to resize the
symbol to see all its content.
265
Events (OOM)
Events (OOM)
An event is the occurrence of something observable. The occurrence is
assumed to be instantaneous and should not have duration.
An event can be created in the following diagrams:
Statechart Diagram
Events convey information specified by parameters. They are used in the
statechart diagram in association with transitions: they are attached to
transitions to specify which event fires the transition. They are also used in
association with actions: the event can trigger the change of state of a
classifier or the execution of an internal action on a state.
The same event can be shared between several transitions and actions. It is
reusable by nature because it is not dependent on the context.
The event icon in the Browser is the following symbol:
Predefined events
You can select an event from the Trigger Event list in the action and
transition property sheets. You can also select a predefined event value from
the Trigger Event list if you define the event on an action.
The list of events contains the following predefined values:
Entry: the action is executed when the state is entered
Do: a set of actions is executed after the entry action
Exit: the action is executed when the state is exited
Examples
266
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Event properties
You can modify an objects properties from its property sheet. To open an
event, double-click its Browser entry in the Events folder. The following
sections detail the property sheet tabs that contain the properties most
commonly entered for events.
Event property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
Events (OOM)
Description
Parent
Name
Code
Comment
Data type
Array
Parameter
Type
Default
value
268
269
Actions (OOM)
Actions (OOM)
An action is a specification of a computable statement. It occurs in a specific
situation and may comprise predefined events (entry, do and exit) and
internal transitions.
An action can be created in the following diagrams:
Statechart Diagram
Internal transitions can be defined on a state, they are internal to the state and
do not cause a change of state; they perform actions when triggered by
events. Internal transitions should not be compared to reflexive transitions
on the state because the entry and exit values are not executed when the
internal event occurs.
An action contains a Trigger Event property containing the specification of
the event that triggers the action.
270
Creating an action
You can create an action in any of the following ways:
Open the Actions tab in the property sheet of a state, and click the Add a
Row tool
Open the Trigger tab in the property sheet of a transition, and type the
action name in the Trigger action box
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Action properties
You can modify an objects properties from its property sheet. To open an
action property sheet, double-click its diagram symbol or its Browser entry
in the Actions folder. The following sections detail the property sheet tabs
that contain the properties most commonly entered for actions.
Action property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
271
Actions (OOM)
Property
Description
Stereotype
Trigger event
Operation
Read-only list that lists operations of the classifier associated with the state. It allows you to specify the action
implementation using an operation. It is grayed and
empty when the classifier is not a class
Operation arguments
the event specified by the trigger event occurs. The Condition tab is
available for actions defined on states. It displays the following property:
Alias
273
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
274
Description
Name
Code
Comment
Stereotype
275
CHAPTER 5
Contents
page
278
279
282
Components (OOM)
284
Nodes (OOM)
296
300
Files (OOM)
303
306
277
278
279
Object
280
Tool
Symbol
Description
Component
Represents a shareable piece of implementation of a system. See Components (OOM) on page 284.
Interface
Port
Part
Generalization
Realization
Semantic relationship between classifiers, in which one classifier specifies a contract that another classifier
guarantees to carry out. See the Realizations section in the Building
Structural Diagrams chapter.
Require Link
Assembly
Connector
Object
Tool
Symbol
Description
Delegation
Connector
Dependency
281
282
Tool
Symbol
Description
Node
Physical element that represents a processing resource, a physical unit (computer, printer, or other hardware units).
See Nodes (OOM) on page 296.
Component instance
Node association
Dependency
283
Components (OOM)
Components (OOM)
A component is a physical, replaceable part of a system that packages
implementation, conforms to and provides the realization of a set of
interfaces. It can represent a physical piece of implementation of a system,
like software code (source, binary or executable), scripts, or command files.
It is an independent piece of software developed for a specific purpose but
not a specific application. It may be built up from the class diagram and
written from scratch for the new system, or it may be imported from other
projects and third party vendors.
A component can be created in the following diagrams:
Component Diagram
The symbol of the component is as follows:
Creating a component
You can create a component in any of the following ways:
Use the Component tool in the diagram Palette
Select Model Components to access the List of Components, and click
the Add a Row tool
Right-click the model or package in the Browser, and select New
Component
Select Tools Create Component to access the Standard Component
Wizard
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
285
Components (OOM)
3. Type a name and a code for the component and click Next.
4. If you want the component to have a symbol and appear in a diagram,
then select the Create Symbol In checkbox and specify the diagram in
which you want it to appear (you can choose to create a new diagram). If
you do not select this checkbox, then the component is created and
visible from the Browser but will have no symbol.
5. If you want to create a new class diagram to regroup the classes selected,
then select the Create Class Diagram for Component Classifiers.
Component properties
You can modify an objects properties from its property sheet. To open a
component property sheet, double-click its diagram symbol or its Browser
entry in the Components folder. The following sections detail the property
sheet tabs that contain the properties most commonly entered for
components.
Component property sheet General tab
The General Tab contains the following properties:
286
Property
Description
Name
Code
Comment
Stereotype
287
Components (OOM)
Property
Description
Type
category.
Class diagram
Web service
For more information on the class diagram property, see Creating a class
diagram for a component on page 293.
Component property sheet Related Diagrams tab
The Related Diagrams tab lists all the diagrams that are related to a
component. They can be attached and detached from the current component
at this stage.
288
or
289
Components (OOM)
The interfaces appear in the list, and their definitions are added to the
current component definition. Interfaces are created in the same package
as the component.
Component property sheet Classes tab
Classes contained in the component are classes implementing the
component.
A component has one or several classes. It usually uses one implementation
class as the main class, while other classes are used to implement the
functions of the component. Typically, a component consists of many
internal classes and packages of classes but it may also be assembled from a
collection of smaller components.
These classes have no symbol in the component diagram, unlike interfaces.
However, the relationship between the class and the component is visible
from the Classes tab of the component property sheet, and from the
Components tabbed page in the Dependencies tab of the class property sheet.
Classes of a component can be in the same model or in another model. If
they are in another model, you can use external shortcuts of classes.
290
You can define a class for a component from the Classes tab of the
component property sheet.
v To define a class for a component
1. Click the Create a New Class tool to create a new class. The class
property sheet is displayed.
2. Type a name and a code and click OK.
or
Click the Add Objects tool to display a Selection window.
Select the classes you want to attach to the component and click OK.
The classes appear in the list, and their definitions are added to the
current component definition. Classes are created in the same package as
the component.
Component property sheet Ports tab
The Ports tab lists the ports associated with the component. You can create
ports directly in this tab. For more information, see the Ports section in the
Building Structural Diagrams chapter.
291
Components (OOM)
The Open Class Diagram feature, available from the component contextual
menu, opens the specific class diagram if it exists, or it creates a new default
class diagram.
For EJB components for example, the Open Class Diagram feature opens the
class diagram where the Bean class of the component is defined.
293
Components (OOM)
294
or
Select an existing node.
3. Click OK.
The node includes a new component instance that refers to the current
component.
295
Nodes (OOM)
Nodes (OOM)
A node is the main element of the deployment diagram. It is a physical
element that represents a processing resource, a real physical unit, or
physical location of a deployment (computer, printer, or other hardware
units).
In UML, a node is defined as Type or Instance. This allows you to define for
example BackupMachine as node Type, and Server:BackupMachine as
Instance. As a matter of simplification, PowerDesigner handles only one
element, called node, which actually represents a node instance. If you need
to designate the type, you can use a stereotype for example.
A node can be created in the following diagrams:
Deployment Diagram
The symbol of a node is a cube:
Composite view
You can expand a composite node to have a global view of the whole
diagram content. To do so, you have to right-click a composite node and
select Composite View from the contextual menu. You must resize the
composite node symbol to visualize its content.
To return to the composite node normal view, re-select the Composite View
command in the contextual menu of the expanded composite node.
Creating a Node
You can create a node in any of the following ways:
Use the Node tool in the diagram Palette
Select Model Nodes to access the List of Nodes, and click the Add a
Row tool
Right-click the model or package in the Browser, and select New Node
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Node properties
You can modify an objects properties from its property sheet. To open a
node property sheet, double-click its diagram symbol or its Browser entry in
the Nodes folder. The following sections detail the property sheet tabs that
contain the properties most commonly entered for nodes.
Node property sheet General tab
The General Tab contains the following properties:
Property
Description
Name
Code
Comment
Stereotype
Cardinality
Network
address
Nodes (OOM)
Node diagrams
You can expand a node in a diagram owned by the node, in order to define its
contents: the associated component instances and its file objects.
This diagram is a deployment diagram within a node. It is called a node
diagram.
Creating a node diagram
You create a node diagram from the symbol of the parent node.
v To create a node diagram
1. Press CTRL and double-click the parent node symbol from the deployment
diagram.
A default deployment diagram opens in the diagram window. The node
of the parent node is marked with a + sign in the Nodes category of the
Browser.
If you expand the node of the parent node, you see that a deployment
diagram is automatically created. It is the node diagram in which you can
create any component instances and file objects associated with the node.
or
Select Open Diagram from the contextual menu of the parent node.
The node diagram opens in the diagram window.
Closing a node diagram
You can close a node diagram using the following methods:
Press CTRL + U in the node diagram to go up to the parent diagram.
or
Select Diagram Go Up One Level from the contextual menu.
299
You can drag a component from the Browser and drop it into a deployment
diagram to automatically create a component instance linked to the
component.
The component instance that inherits from the component automatically
inherits its type: the type of the component is displayed in the property sheet
of the component instance.
Deploy component to
node from the
component diagram
You can create a component instance from a component. To do this, use the
Deploy Component to Node feature. This feature is available from the
contextual menu of a component (in the component diagram) or from the
Browser. This creates a component instance and attaches the component
instance to a node. If you display the node symbol in a deployment diagram,
the component instance name is displayed within the node symbol to which
it is attached.
300
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Stereotype
Cardinality
Component
Component
type
Web service
301
302
Files (OOM)
A file object can be a bitmap file used for documentation, or it can be a file
containing text that is used for deployment into a server.
A file can be created in the following diagrams:
All Diagrams
The symbol of a file object is as follows:
The file object can have a special function in a deployment diagram, where it
can be specified as an artifact (by selecting the Artifact property) and
generated during the generation process.
When you want to associate a file object to a node, you can drag a
dependency from the file object to the node:
You can also use CTRL and double-click on the parent node symbol, then
create the file object into the node diagram.
You can edit a file object by right-clicking its symbol in the deployment
diagram and selecting Open Document or Open With text editor of your
choice from the contextual menu.
+ For more information on file objects, see section Using file objects in
chapter Managing objects in the General Features Guide .
303
Files (OOM)
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Description
Name
Code
Comment
Stereotype
Location
Type
304
Location
Extension
Generate
Property
Description
Artifact
+ For more information on file objects, see section Using file objects in
chapter Managing objects in the General Features Guide .
305
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
306
Property
Description
Name
Code
Comment
Stereotype
Role A
Node A
Multiplicity
A
Role B
Node B
307
308
Property
Description
Multiplicity
B
CHAPTER 6
This chapter explains how you can customize the environment in which you
build your Object-Oriented Model.
Topic:
page
310
311
312
316
321
323
309
310
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.
311
These options affect all the objects in the model, including those already
created. You can set the following options:
All objects
These options apply to all objects:
312
Option
Definition
Name/Code
case sensitive
You can define the case sensitivity of names and codes for all
objects in the current model. When this check box is selected,
it implies that you can have two objects with identical name
or code but different case in the same namespace.
Unlike other model options, you can modify the name and
code case sensitivity during the design process. However,
if you do so, make sure you run the check model feature to
verify if the model does not contain any duplicate object.
Enable links
to requirements
Show classes
as data types
Preview editable
Definition
Attribute
Operation
Parameter
313
For more information on data types in the object language, see section Data
types category in chapter Object Languages Reference Guide in the
Advanced User Documentation.
Domain/Attribute
These options apply to domains:
Option
Function
Enforce nondivergence
Specifies that the full data type name is used for attribute
data types instead of its abbreviated from. Provides a clear
persistent data type list for attributes.
Description
Message
These options apply to messages:
Option
Description
Support delay
Interface/class
These options apply to interfaces realized by classes:
314
Option
Description
Auto-implement
realized interfaces
Class attribute
default visibility
Allows you to set the default visibility of all class attributes in the model
315
To set display preferences for a particular object, select it under the Object
View category. The following table provides an alphabetical list of the
display preferences available. Note that each object supports only some of
these preferences, and that the objects available to be customized in the
Display Preferences window depend upon the current diagram type.
Changing the format of symbols
For information about changing the format of symbols, see the Selecting
format display preferences section in the Model Graphics chapter in the
General Features Guide.
316
Preference
Description
Actions
Activation attachment
Activity Parameter
[activities] Displays the boxes that represent the parameters of the activity, on the edge of its symbol.
Association
name
Association
role names
Attribute values
Attributes
[classes and interfaces] Controls whether classifier attributes are displayed. If selected, allows you to further
choose between:
All - Display all attributes
Limit Display attributes up to the limit specified in
the adjacent box
Comment
Constraints
Data type
[attributes] Displays the data type of the attribute.
317
Preference
Description
Direction
318
Display Instance
Domain
Event arguments
[transitions] Displays the arguments of the events associated with the transition.
Headers always
visible
Initial value
Inner classifiers
Interaction
Symbol
Interface Name
Lifeline attachment
Location
Multiplicity
[associations and node associations] Displays the multiplicity of the relationship. You can choose between the
actual number of instances (String) or the symbol at each
end of the relationship (Symbol)
Preference
Description
Name
Name if no
condition
Network address
Operations
[classes and interfaces] Controls whether classifier operations are displayed. If selected, allows you to further
choose between:
Type - Display all operations
Limit Display operations up to the limit specified in
the adjacent box
Ordering
Organization
unit swimlane
[sequence diagram in General category] Displays organization units as swimlanes. When selected, you can
choose between Horizontal and a Vertical lanes.
Parameters
Return type
Role names
Stereotype
319
Preference
Description
Time
Type
Visibility
320
When you create an OOM in Java or .NET languages, the Extended Model
Definitions page in the New dialog box contains the WSDL extended model
definition file. It is attached by default to these object languages at creation
of the model.
When you attach an extended model definition to an object model, you can
choose one of the following options:
321
Option
Definition
Share
Current extended model definition constantly refers to the extended model definition stored in the Resource Files\Extended
Model Definitions directory. Any changes made to the extended
model definition are shared by all linked XEM
Copy
Current extended model definition is a unique copy of the extended model definition stored in the Resource Files\Extended
Model Definitions directory. The current extended model definition is independent of the original one, so modifications made
to the extended model definition in the Resource Files\Extended
Model Definitions directory are not available to the copied XEM.
This one is saved with the OOM and cannot be used without it
322
323
CHAPTER 7
This chapter describes how to create and work with Web services in an
Object-Oriented Model (OOM).
Topic:
page
326
331
342
352
355
363
368
380
325
326
327
Types: a container for data type definitions using some type system (such
as XSD)
Message: an abstract, typed definition of the data being communicated
Operation: an abstract description of an action supported by the service
Port Type: an abstract set of operations supported by one or more
endpoints
Binding: a concrete protocol and data format specification for a
particular port type
Port: a single endpoint defined as a combination of a binding and a
network address
Service: a collection of related endpoints
Interface and
implementation
WSDL is used to define the Web service interface, the Web service
implementation, or both. As a result, it is possible to use two WSDL files,
one for the interface and one for the implementation.
In an interface WSDL, you declare the procedures that allow you to create a
Web service.
In an implementation WSDL, you define how to implement these
procedures through services and ports (access endpoints URLs).
In an OOM, an interface WSDL is associated with a component, and an
implementation WSDL is associated with a component instance. You can
save both WSDL files within the model.
328
SOAP stands for Simple Object Access Protocol. It is a protocol based upon
XML for exchange of information in a distributed environment. It represents
the invocation mechanism within a Web service architecture. WSDL allows
a user to understand which format of the SOAP message should be sent to
invoke the service and what is the expected return message format.
What is UDDI?
PowerDesigner generates
.asmx files for C# or VB .NET, WSDL files and client proxies in C# or VB
.NET.
329
330
331
Note
Property
Description
Web service
class
Web service class name. You can click the Properties tool
beside this box to display the class property sheet, or click the
Create tool to create a class. If the Web service component
is a Stateless Session Bean, the Web service class is the bean
class as well
Application
namespace
WSDL URL
Web service
type
Interface or Implementation type. Interface refers to a component that defines the service interface only. Implementation
refers to a component that implements a service interface
Use external
WSDL
For Session Beans, the Web service class and the bean class are
synchronized; if you apply some changes in the EJB tab, the Web Service
tab is automatically synchronized.
A Web service component may have an external WSDL if it is created from
an external WSDL URL. In this case, the WSDL may be published by
another organization, and you can either use it, or implement it. A Web
service component created from a class can have its own WSDL.
You cannot change the WSDL URL of an external WSDL.
332
Description
Target
namespace
Prefix
Encoding
style
You can choose the SOAP data types (soap:xxx) or the XMLSchema data types (xsd:xxx) for the WSDL
Comment
WSDL editor
You can use the text zone at the bottom of this tab to edit
the contents of the WSDL. When you click the User-Defined
tool, you make the contents user-defined. Once the tool is
clicked, the contents can be overridden. When a WSDL is not
user-defined, it is regenerated each time and can be displayed
in the Preview tab of the component property sheet
Preview tab in the component property sheet. It allows you to preview the
code of the following items:
Web Service class and interfaces (for Java)
.ASMX file (for .NET)
Display the component tabs
You can display some of the tabs of a component property sheet by rightclicking the component symbol in the diagram and selecting the appropriate
tab from the contextual menu.
Extended attributes tab of the component
You can preview the extended attributes associated with a Web service
component by clicking the UDDI or the Extended attributes tab in the
component property sheet.
334
Name
Internal code
Description
SOAP binding
style
SoapBindingStyle
SOAP binding
transport
SoapBindingTransport
SOAP body
namespace
SoapBodyNamespace
Business name
BusinessName
Business description
BusinessDescription
Business key
BusinessKey
Namespaces
Namespaces
Service name
ServiceName
Name
Internal code
Description
Service description
ServiceDescription
Service key
ServiceKey
tModel name
tModelName
tModel key
tModelKey
tModel URL
tModelURL
UDDI operator
URL
UDDIOperatorURL
You must create the Web service component within a package so that the
package acts as a namespace.
The wizard for creation of Web services lets you define the following
parameters:
335
336
Property
Description
Name
Code
Component type
Create symbol
2. Type a name and code for the Web service component and click Next.
Steps of the wizard
If you have selected classes before starting the wizard, some of the
following steps are omitted because the different names are created by
default according to the names of the selected classes.
When you create a Web service with the wizard, you have to select the
type of the Web service and the type of the component that is used as a
source. The following table maps available component types to Web
service types in Java:
337
Component
type
Java service
interface
Use
Standard
Java class
Axis RPC
Java class
Axis EJB
EJB Stateless
Session Bean
JAXM
Java Servlet
JAX-RPC
Java class
Web Service
for J2EE
EJB Stateless
Session Bean
4 = allowed
= not allowed
3. Select a Web service type and a component type and click Next.
4. Select a Web service implementation class and click Next.
5. At the end of the wizard, you have to define the creation of symbols.
When you have finished using the wizard, the following actions are
executed:
A Web service component flagged as Web service is created
A Web service implementation class is created and visible in the Browser.
It is named after the original class if you have selected a class before
starting the wizard. If you have not selected a class beforehand, it is
prefixed after the original default component name to preserve coherence
A default operation with the Web method flag is created
Depending on the component type, required interfaces associated with
the component are added
338
or
From the parameter property sheet, select or type a new data type from
the WSDL data type box.
2. Click Apply
Declaring data types in the WSDL
Classes used as data types are declared as Complex Types inside the
<types> section of WSDL.
Java
Property
Description
Web service
component
Serialization
class
Deserialization
class
property sheet. It allows you to preview the code of the following items:
The Web service implementation class in Java
The .ASMX file in .NET
The interface WSDL generated from the component and implementation
class in Java and .NET (it is in read-only mode)
341
JAXM
For JAXM Web Service component, the implementation of the Web Service
must be done in the onMessage() method. To be able to generate the correct
WSDL, you have to declare a Web Service method without implementation
to define the input SOAP message and the output SOAP message.
4. Click Apply and click the Properties tool to display the operation
property sheet.
5. Select the Web Service method check box in the General tab.
6. Click OK.
343
Property
Description
SOAP extension
class
Data type for the return type. It includes basic data types
from the object language and complex data types from
the WSDL Schema. You can click the Properties tool
beside this box to display the WSDL Schema tab of the
component property sheet. This tab shows the contents of
the WSDL schema
The SOAP Input tab defines the name and schema of the SOAP input
message element.
The SOAP Output tab defines the name and schema of the SOAP output
message element.
The SOAP Fault tab defines the default name and schema of the SOAP fault
message element.
For more complex return types, you can manually define the output message
schema using the SOAP Output tab of the operation property sheet.
345
For simple parameter values, the input message type is generated from the
WSDL types of the parameters. If a parameter is a class or an array of class,
PowerDesigner will only generate SOAP binding.
346
347
For a Web Service method in a JAXM Web Service, you have to implement
the onMessage() method. You have to process the input SOAP message,
generate an output SOAP message and return the output message.
348
350
+ For more information on this check, see section Objects verified during
Check model, in chapter Working with Object-Oriented Models.
When generating, the WSDL schema is composed of the shared schema
definitions from the component, and a computed combination of all SOAP
input, output, and fault definitions from the operations.
You can type the SOAP input, SOAP output and SOAP fault data type names
in the appropriate tabs in the operation property sheet. Each tab contains a
box, and a text zone in which you can edit the data type definition from the
WSDL schema.
351
Description
Access point
URL
WSDL URL
Use external
WSDL
352
Here are some examples of the syntax used in .NET and Java:
For .NET, the default syntax is:
accesstype://machine_networkaddress:port/application_
namespace/webservice_code.asmx
353
Property
Description
Target namespace
Import interface
WSDL
Comment
WSDL editor
You can also use a text zone below the Comment area to
display the contents of the WSDL. When you click the
User-Defined tool among the available tools, you make
the contents user-defined. Once clicked, the contents can
be overridden
You can display some of the tabs of the property sheet of a component
instance by right-clicking the component instance symbol in the diagram
and selecting the appropriate tab from the contextual menu.
Description
Network address
Since a machine can be used for several services and each service may have
a different access type, port number and path, the machine Network address
is only used as a default value. You can redefine the real URL of each
component instance in the property sheet of the component instance at any
time.
354
355
invocation for Web Services but it is limited to simple message formats. You
can use very complex Objects/XML mapping.
Using the JAX-RPC model implies to:
Generate the Web Service Java class and interface code
Compile the Web Service Java class and interface
Run a JAX-RPC tool to generate server side artifacts and client side
proxy to handle the Web Service
Package all the compiled code, WSDL and deployment descriptor in a
.WAR file
Deploy the .WAR file in a server that supports JAX-RPC
To use JAX-RPC You can use the Java Web Services Developer Pack
(JWSDP) 1.1 or higher from Sun or other application servers that support
the JAX-RPC model. You can download JWSDP from
http://java.sun.com/webservices/
If you use
JWSDP, you can use the wscompile.bat tool. For other JAX-RPC compatible
implementations, please refer to the documentation. To invoke the
wscompile.bat tool from PowerDesigner, you have to define an environment
variable WSCOMPILE in the Variables category located in the
Tools>General Options windows. The WSCOMPILE variable should
indicate the full path of the wscompile.bat file. To run wscompile.bat, the
jaxrpc-api.jar file must be in your CLASSPATH environment variable. You
can also define a JAVACLASSPATH variable in PowerDesigner to define the
classpath specific to PowerDesigner, in this case the JAVACLASSPATH
variable replaces the CLASSPATH environment variable
357
4. Click OK.
If you have a server like Apache Tomcat that supports JAX-RPC, you can
add a profile and use the deployment command to deploy the generated
.WAR file directly into the server.
359
4. Click OK.
If you have an application server that supports Web Services for J2EE, you
can add a profile and use the deployment command to deploy the generated
.JAR file directly into the server.
undeploy.wsdd files are generated for all Web service components of the
model or package.
If you use Apache Tomcat with Axis support installed, you can deploy the
Web services directly. To support Apache Tomcat, you need to add the
Apache Tomcat profile (extended model definition) to your model. You also
need to define the CATALINA_HOME variable in the General Options
dialog box (Tools>Generation Options) to specify the home directory of
Apache Tomcat. To deploy the Web services into Tomcat, PowerDesigner
uses an Apache Ant build.xml file. Make sure that Apache Ant is installed
and check that you have defined an ANT_HOME variable in the General
Options dialog box (Tools>Generation Options) to indicate where the home
directory of Apache Ant is located.
If you use another application server that supports Axis, you need to add the
application server profile in order to package and deploy the Web services
directly into the server.
v To generate Apache Axis Web Service components
1. Select Language Generate Java Code.
2. Select a directory where you want to generate the code.
3. If you want to deploy Web services in an application server, you can
define deployment options in the options tab. For example, for Apache
Tomcat, you can define host name, port number, user name, password.
4. If you want to deploy Web services in an application server, you can
select the command in the Tasks tab. For example, for Apache Tomcat,
you can select the Tomcat: Deploy Axis Web Services in Tomcat.
It is not necessary to define the super class (also known as WebService) for
the Web service classes; if the WebService super class is not defined, the
code generator adds it to the code.
When generating the server side code, you can use the following default
options and tasks that help you automatically start generating with
pre-defined characteristics.
VB.NET generation
options
The following options are available from the Options tab in the Generation
dialog box for C#:
Option
Description
The following options are available from the Options tab in the Generation
dialog box for VB.NET:
Option
Description
363
Option
Description
364
365
4. Click OK.
367
368
369
11. Click the Implementation tab and type the method implementation, that is
to say the implementation of the Java Web service.
370
3. Click OK.
The package hierarchy is created.
Customizing and previewing the Java Web service using the Web service component
The Java Web service is represented by a Web service component. You can
customize the Web service using the component attributes (Name,
Comment, Author and so on).
You can also preview the Java code corresponding to the Web service either
from the implementation class of the component property sheet.
v To preview the Java Web service code
1. Double-click the implementation class.
or
Double-click the component.
The corresponding property sheet is displayed.
2. Click the Preview tab to display the Preview tab and check the
implementation/component code.
Generating the corresponding Java Web service for Sybase WorkSpace
The Web service generation allows you to create the following files:
A svc_java file that defines the Java Web service
A .java file for the implementation of the Java Web service
371
command.
When you generate using the PowerDesigner Eclipse plugin
You also
372
Field
Component property
serviceName
serviceComment
projectName
serviceFilename
%serviceName%.svc_java
authorName
dateCreated
operationName
operationComment
Field
Component property
static
inputMessage
outputMessage
returnType
parameterName
parameterComment
dataType
javaServiceParamType
classFullPath
%projectName %/ %qualifiedClassName%
qualifiedClassName
Open the Java Web service in the Workspace Java Service Editor
After generating the Java Web service in PowerDesigner, you can open it
with the Java Service Editor to further implement it.
v To open the Java Web service in the Workspace Java Service Editor
1. Right-click the .svc_java file in the Navigator window and select Open
with Java Service Editor.
The Java Service Editor tab is displayed in the Editor area.
2. Click the Interface sub-tab to display the Service Interface tab.
3. Resume service implementation.
373
If the CLASSPATH environment variable is not defined, you can still define
the JAVACLASSPATH local variable as explained below.
You also need to define the following PowerDesigner local variables from
the Tools General Options dialog box:
Variable
Use
J2EE_HOME
JAGTOOL
JAVACLASSPATH
374
375
+ For more information, see section Defining the Java class package on
page 370.
Customizing and previewing the EJB Web service using the Web service component
The EJB Web service is represented by a Web service component. You can
customize the Web service using the component attributes (Name,
Comment, Author and so on).
You can also preview the Java code corresponding to the Web service either
from the implementation class of the component property sheet.
v To preview the EJB Web service code
1. Double-click the implementation class.
or
Double-click the component.
The corresponding property sheet is displayed.
2. Click the Preview tab to display the Preview tab and check the
implementation/component code.
Generating the corresponding EJB Web service for Sybase WorkSpace
The Web service generation allows you to create the following files:
A svc_ejb file that defines the EJB Web service
.java files for the EJB bean class, home and remote interfaces
The EJB deployment descriptor
A .project file for creating a Java project if it does not exist
A .classpath file for defining Java libraries in a Java project
A build.xml Ant script file used to compile, package and deploy the EJB
When you generate in PowerDesigner
command.
When you generate using the PowerDesigner Eclipse plugin
You also
376
Component property
serviceName
serviceComment
projectPath
serviceFilename
%serviceName%.svc_java
authorName
dateCreated
ejbFullName
<PackageCode>.<ComponentCode>
377
Field
Component property
operationName
operationComment
inputMessageName
outputMessageName
returnType
parameterName
parameterComment
dataType
classFullPath
%projectPath%/ %qualifiedClassName%
qualifiedClassName
endpointName
connectionName
EJBComponentURI
jndiProviderURL
initialContextFactory
jndiName
clientJAR
ejbRemoteInterface
ejbHomeInterface
378
After generating the EJB Web service in PowerDesigner, you can open it
with the Java Service Editor to further implement it.
v To open the EJB Web service in the Workspace Java Service Editor
1. Right-click the .svc_ejb file in the Navigator window and select Open
with Java Service Editor.
The Java Service Editor tab is displayed in the Editor area.
2. Click the Interface sub-tab to display the Service Interface tab.
3. Resume service implementation.
379
380
Note
Item
Description
WSDL URL
Package
Defines the package and namespace where the component and the Web service class are created
Component type
Preview WSDL
If the WSDL contains a section prefixed with <! service >, a component
instance is created. This section is displayed in the WSDL tab in the
property sheet of the component instance.
v To reverse engineer WSDL files
1. Select Language Import WSDL to display the Import WSDL dialog
box.
2. Click the Selection tab to display the Selection tab.
3. Select the WSDL file that you want to import.
4. Select a package.
5. <Java only> Select a component type.
6. Select the Web services and port types you want to import.
381
7. Click OK to reverse.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
382
Item
Description
Create in component
diagram
Item
Description
UDDI operator
URL
UDDI version
Search for
Search in
The result is displayed in the Search Result window, it shows the Business
entity name, the Service name, the Service description, and the WSDL URL.
Notes
After you browse UDDI, the data reversed into the OOM is stored into the
UDDI tab of the component property sheet.
You need to have Internet Explorer 5 or higher to use the Browse UDDI
feature.
v To browse WSDL files from UDDI
1. Select Language Import WSDL to display the Import WSDL dialog
box.
2. Click the Selection tab to display the Selection tab.
3. Click the Browse UDDI tool beside the WSDL URL box to display the
Browse UDDI dialog box.
384
385
10. <optional> Click the Business Entity tab to display data about the
company.
11. <optional> Click the Business Service tab to display data about the
service.
386
+ For more information on the Import WSDL dialog box, see section
Importing a WSDL file on page 380
387
CHAPTER 8
Contents
Topic:
page
390
391
Checking an OOM
400
433
435
389
+ For more information, see the Defining related diagrams section in the
Managing Models chapter of the General Features Guide .
390
Attached to
See section
State
Object
Component
Component
instance
Class
Object node
Message
Operation
(class)
Association
Instance link
391
The Implementation Classes tab in the use case property sheet shows the list
of classes, or interfaces used to implement a use case. A use case is
generally a task or service, represented as a verb. When analyzing what a
use case must do, it is necessary to identify the classes and interfaces that
need to be created to fulfill the task. In this logic, it is possible to create the
classes or interfaces and attach them to a use case.
For example, a use case ship product by express mail needs the classes
Shipping, Product, and Billing to perform its task. They are shown as
related to the use case in the figure below.
All classes and interfaces of the model are displayed by default. Use the
Include Sub-Packages tool beside the Folder Selection list to increase
the selection, it allows you to include all the classes and interfaces from
the packages of the model.
4. Select the objects as required and click OK.
392
The Implementation Classes tab shows the list of classes and interfaces used
to implement an actor. An actor can be a human being (person, partner) or a
machine, or process (automated system). When analyzing what an actor
must do, it is necessary to identify the classes and interfaces that need to be
created for the actor to perform his task. In this logic, it is possible to create
the classes or interfaces and attach them to an actor.
For example, an actor Car needs the classes Engine and Motorway to
perform its task. They are shown as related to the actor in the figure below.
393
All classes and interfaces of the model are displayed by default. Use the
Include Sub-Packages tool beside the Folder Selection list to increase
the selection, it allows you to include all the classes and interfaces from
the packages of the model.
4. Select the required objects and click OK.
394
Conceptually, you may link those elements even deeper. Here is an example
of an actor in a use case diagram that becomes an object in a communication
diagram. This object is then related to a class of a class diagram because it is
an instance of this class:
A clerk works in an insurance company. He is an actor of a use case
diagram, dealing with customers who declare a car accident.
The clerk actor becomes an object in a communication or sequence diagram;
those diagrams representing the actions between the objects, the clerk as an
object receives messages from customers and sends messages to his
manager, for example.
The clerk as an object is also an instance of a class Clerk that can be found
in a class diagram with its attributes and operations.
395
You can drag a use case, class or component from the Browser and drop it
into the statechart diagram. You can also copy it and paste it, or paste it as
shortcut, into the statechart diagram.
396
mode. For all these reasons, you can link a class or an interface to an object
in an OOM.
From the object property sheet, you can:
Link the object to an existing class or interface
Create a class
v To link a class or interface to an object
1. Select a class or interface from the Classifier list in the object property
sheet.
or
Click the Create Class tool beside the Classifier list to create a class and
display its property sheet.
Define the properties of the new class and click OK.
The class or interface name is displayed in the Classifier list.
2. Click OK.
The object name is displayed in the sequence diagram, followed by a
colon, and the name of the class or interface selected.
You can similarly view the object name in the class or interface property
sheet: click the Dependencies tab and select the Objects sub-tab. The
object name is automatically added in this sub-tab.
Turning a class or interface into an object
You can drag a class or interface node from the Browser and drop it into the
sequence, communication or object diagrams. You can also copy a class
or interface and paste it, or paste it as shortcut, into these diagrams. This
automatically creates an object, instance of the class or of the interface.
397
or
Click the Create tool beside the Component list to create a component
and display its property sheet.
Define the properties of the new component and click OK.
The component name is displayed in the Component list.
2. Click OK.
The component instance name is displayed in the deployment diagram.
You can similarly view the component instance name in the component
property sheet: click the Dependencies tab and select the Component
Instances sub-tab. The component instance name is automatically added
in this sub-tab.
Turning a component into a component instance
You can drag a component node from the Browser and drop it into the
deployment diagram. You can also copy a component and paste it, or paste
it as shortcut, into the deployment diagram. This automatically creates a
component instance, instance of the component.
+ For more information about object nodes, see Object Nodes (OOM) in
the Building Dynamic Diagrams chapter.
or
Click the Create tool beside the Operation list to create an operation and
display its property sheet.
Define the properties of the new operation and click OK.
The operation name is displayed in the Operation list.
2. Click OK.
If you selected the Replace by Operation Name display preference, the
message displays the name of the operation.
When you create an operation, the name of the operation is also
automatically added to the class and is displayed in the Operations tab of
the class property sheet.
399
Checking an OOM
Checking an OOM
The Object-Oriented Model is a very flexible tool, which allows you quickly
to develop your model without constraints. You can, however, check the
validity of your OOM at any time.
Check your OOM before generating code
We recommend that you check your OOM before generating code from
it. If the check encounters errors, generation will be stopped. The Check
model option is enabled by default in the Generation dialog box.
v To check an OOM
1. Press F4, or
2. Select Tools Check Model, or
3. Right-click the diagram background and select Check Model from the
contextual menu
The Check Model Parameters window opens, which allows you to specify
the kinds of checks to perform, and the objects to apply them to. For detailed
information about this window and correcting problems reported, see
Checking a Model in the Managing Models chapter of the General
Features Guide .
The following sections document the checks available by default for a OOM.
Domain checks
The following OOM model checks are made on domains:
400
Check
Domain name
and code
uniqueness
Inconsistency
between default values
and check parameters
The values entered in the check parameters tab are inconsistent for numeric and string data types: default does not
respect minimum and maximum values, or default does not
belong to list of values, or values in list are not included
in minimum and maximum values, or minimum is greater
than maximum value. Check parameters must be defined
consistently.
Business rule
name and code
uniqueness
The business rule you have created is not used in the model.
Manual correction: Apply the business rule to an object in
the model
Automatic correction: None
401
Checking an OOM
Check
Embedded file
name uniqueness
Existence of
external file
location
Replication checks
The following OOM model checks are made on replications:
Check
Partial object
replication
Data source
name and code
uniqueness
Existence of
physical data
model
402
Check
Differing
DBMS types
Package checks
The following OOM model checks are made on packages:
Check
Circular inheritance
Circular dependency
Shortcut code
uniqueness
Checking an OOM
Check
Actor/use case
name and code
uniqueness
Actor and use case names and codes must be unique in the
namespace (model or package).
Manual correction: Modify the duplicate name/code
Automatic correction: Appends a number to the duplicate
name/code
Actor/use case
not linked to
any object
Class checks
The following OOM model checks are made on classes:
Check
Class name
and code
uniqueness
Empty classifier
404
Persistent class
without persistent attributes
Association
class with
identifier(s)
Check
Classifier visibility
Operation implementation
Role name
assignment
Role name
uniqueness
405
Checking an OOM
Check
Emuneration
type parent
Bean class
Business methods implementation
406
Check
Bean class
Home interface methods
implementation
407
Checking an OOM
Check
Bean class
ejbCreate
methods
Bean class
ejbPostCreate
methods
408
Check
Bean class
ejbFind methods
Primary key
class definition
409
Checking an OOM
Check
Primary key
class attributes
Primary key
class existence
If the bean class has more than one primary key attribute
then a primary key class must exist. If there is only one
primary key attribute, it cannot have a standard data type,
but must have an object data type (ex: java.lang.Long).
Manual correction: If there are many primary key attributes,
create a primary key class. If there is only one primary key
attribute, select an object/classifier data type
Automatic correction: Creates a primary key class, or
selects the appropriate object/classifier data type
Class mapping
not defined
410
Check
Incomplete
bound classifier
Identifier checks
The following OOM model checks are made on identifiers:
Check
Identifier name
and code
uniqueness
Existence of
attribute
Identifier inclusion
Interface checks
The following OOM model checks are made on interfaces:
411
Checking an OOM
Check
Interface name
and code
uniqueness
Empty classifier
Classifier visibility
Interface constructor
Interface navigability
412
Check
413
Checking an OOM
Check
Remote Home
interface methods
Component
interface business methods
Incomplete
bound classifier
414
Check
Attribute name
and code
uniqueness
Check
Inconsistencies
within check
parameters
The values entered in the check parameters tab are inconsistent for numeric and string data types: default does not
respect minimum and maximum values, or default does not
belong to list of values, or values in list are not included
in minimum and maximum values, or minimum is greater
than maximum value. Check parameters must be defined
consistently.
Manual correction: Modify default, minimum, maximum
or list of values in the check parameters tab
Automatic correction: None
Domain divergence
415
Checking an OOM
Check
Operation
name and code
uniqueness
Return type
assignment
Parameter data
type assignment
Abstract operation in a
non-abstract
class
Overloading
operations signature
416
Check
Overriding operations
Realization checks
The following OOM model checks are made on realizations:
Check
Redundant realizations
Realization
generic missing child type
parameters
Realization
generic child
cannot be
bound
417
Checking an OOM
Generalization checks
The following OOM model checks are made on generalizations:
Check
Redundant
generalizations
Class multiple
inheritance
Extend final
class
Non-persistent
specifying attribute
Generalization
generic missing child type
parameters
Generalization generic
child cannot be
bound
Object checks
The following OOM model checks are made on objects:
418
Check
Object name
and code
uniqueness
Isolated object
Message checks
The following OOM model checks are made on messages:
Check
419
Checking an OOM
Check
Message used
by several instance links
State checks
The following OOM model checks are made on states:
Check
Input transition
missing
A composite state details the state behavior in a substatechart diagram. To be complete, this sub-statechart
diagram requires a start.
Manual correction: Add a start in the sub-statechart diagram, or deselect the Composite check box in the state
property sheet
Automatic correction: None
420
Check
Action name
and code
uniqueness
Unspecified
trigger event
Duplicated occurrence
Event checks
The following OOM model checks are made on events:
421
Checking an OOM
Check
Event name
and code
uniqueness
Unused event
Junction point
name and code
uniqueness
Incomplete
junction point
Activity checks
The following OOM model checks are made on activities:
Check
Activity name
and code
uniqueness
422
Check
A composite activity details the activity execution in a subactivity diagram. To be complete, this sub-activity diagram
requires a start connected to other activities, or requires a
start at the beginning.
Manual correction: Add a start in the sub-activity diagram,
or deselect the Composite check box in the activity property
sheet
Automatic correction: None
Non-Reusable
Activity Calls
Decision checks
The following OOM model checks are made on decisions:
Check
Decision name
and code
uniqueness
Incomplete
decision
423
Checking an OOM
Object node
name and code
uniqueness
Object node
with undefined
object
Object Node
Without Data
Type
Organization
unit name and
code uniqueness
Circular dependency
424
Start/end checks
The following OOM model checks are made on starts and ends:
Check
Start/end name
and code
uniqueness
Missing transition
Synchronization checks
The following OOM model checks are made on synchronizations:
Check
Incomplete synchronization
A synchronization represents a fork when a unique transition is split into several output transitions executed in
parallel, or it represents a join when several input transitions are joined and they wait until all transitions reach the
join before continuing as a unique output transition. That
is why a synchronization must have more than one input
transition, or more than one output transition.
425
Checking an OOM
Check
Transition /
flow without
source or destination
Useless condition
Duplicated
transition between states/
Duplicated
flow between
activities
Component checks
The following OOM model checks are made on components:
Check
Component
name and code
uniqueness
Component names and codes must be unique in the namespace (model or package).
Manual correction: Modify the duplicate name/code
Automatic correction: Appends a number to the duplicate
name/code
426
Check
Isolated component
SOAP message
redefinition
You cannot have the same SOAP input and SOAP output
data type inside the same component.
Manual correction: Change the name of the input data type,
or change the name of the output data type in the SOAP
Input or SOAP Output tabs in the operation property sheet
Automatic correction: None
The definition of the SOAP data types is available in the
schema part of the WSDL that you can display in the
WSDL tab of the component property sheet.
Node checks
The following OOM model checks are made on nodes:
Check
Node name
and code
uniqueness
Empty node
427
Checking an OOM
Duplicate
component instances
428
Check
Interaction
reference attached lifelines
consistency
429
Checking an OOM
Class part
name and code
uniqueness
Class part names and codes must be unique in the namespace (model or package).
Manual correction: Modify the duplicate name/code
Automatic correction: Appends a number to the duplicate
name/code
430
Component
assembly connector name
and code
uniqueness
Component
assembly connector null
interface connector
Component
assembly connector interfaces
Association checks
The following OOM model checks are made on associations:
Check
Association
generic missing child type
parameters
Association
generic child
cannot be
bound
431
Checking an OOM
432
Check
Input/output
parameter
name and code
uniqueness
Exchanged object
General
Class diagram
Class
Interface
Attribute
Operation
Parameter
Realization
Generalization
Dependency
Association
Association Class
UseCase
Actor
Association
434
435
CHAPTER 9
Contents
This chapter describes Java, XML, IDL and other reverse engineering
functions for an Object-Oriented Model (OOM), it also describes EJB
reverse engineering. It shows you how to reverse engineer into an OOM and
at the end, how to create a new OOM using reverse engineering.
Topic:
page
438
439
441
443
444
437
When you reverse a language containing one or more inner classifiers into
an OOM, one class is created for the outer class, and one class is created for
each of the inner classifiers. Moreover, an inner link is created between each
inner classifier and the outer class to which it belongs. Inner classifiers are
commonly used in object oriented languages.
For more information on inner classifiers, see the Defining inner classifiers
section, in the Building Structural Diagrams chapter.
Symbol creation
438
If you select the Create Symbols reverse option, the layout of the symbols in
the diagram is automatically arranged. In case of a reverse engineering with
a large number of objects with complex interactions, the auto-layout feature
is likely to create synonyms of objects to improve the diagram readability.
For example, if a class has a large number of associations, the auto-layout
feature will create a synonym of this class in another location of the diagram
in order to improve the diagram presentation.
The Text Input Encoding Format dialog box includes the following options:
Option
Description
Encoding hint
Detection mode
Indicates whether text encoding detection is to be attempted and specifies how much of each file should be
analyzed
On ambiguous
detection
Detection Mode
The Detection Mode specifies which buffer size is used during text encoding
439
Description
No detection
Quick detection
Full detection
On Ambiguous Detection Whenever a detection mode (other than No Detection) has been selected,
you can choose to fine tune the way the encoding should be processed in
case the detection yields an ambiguous result.
On ambiguous detection, you can select one of the following options:
Option
Description
Use encoding
hint and display
warning
Means that there are several valid code pages but that can
produce different results, in this case the encoding hint is
used and a warning message is displayed in the Reverse
tab of the Output window, located in the lower part of the
main window
Use encoding
hint
Use detected
encoding
440
4. <optional> When you reverse into a new OOM, you can select one or
several extended model definitions to reverse at the same time by clicking
the Extended Model Definitions tab, and select the extended model
definitions of your choice.
441
442
443
444
445
Merging models
The Merge Models dialog box shows the From Model (source directory)
in the left pane, and the To Model (current model) in the right pane.
You can expand the nodes in the To Model pane to verify that the merge
actions selected correspond to what you want to perform.
7. Click OK.
The Reverse tab of the Output window displays the changes which
occurred during synchronization and the diagram window displays the
synchronized model.
446
CHAPTER 10
page
448
447
User-defined generation
Object language
What is generated
Analysis
C#
C++
IDL-CORBA
Java
PowerBuilder
Visual Basic.Net
.VB files
XMLDTD
.DTD files
XMLSchema
You can display the generation templates that generate code from the
Preview page in object property sheets, provided the Enable Trace Mode
check box is selected in the object language, or extended model definition
editors.
+ For more information on the trace mode property, see section Object
language properties, in chapter Object Languages Reference Guide in the
Advanced User Documentation .
Check Model
448
You can check your model before generation if you select the Check Model
check box. This check box is available for all languages. The generation
stops if an error is found: you must correct this error before starting the
generation again.
+ For more information on the Check Model feature, see section Checking
an OOM in chapter Working with Object-Oriented Models.
449
Parent
object
Model
Package
or
com/mycompany/myproduct/oom
You can easily modify the order of commands execution using the Move
up or Move down arrows. You can only select one value check box at a
time.
To do this, you must verify that the value Complement Language Generation
is selected in the extended model definition editor.
When you attach an extended model definition to your model, the Targets
page in the Generation dialog box displays the target extended model
definition that can be selected for generation.
452
or
Click OK to generate.
453
CHAPTER 11
page
Generation basics
456
457
460
470
487
455
Generation basics
Generation basics
You can generate an OOM, a CDM, a PDM or an XSM from an OOM.
456
You can use the OOM to OOM generation to generate an analytical OOM
(designed with the Analysis object language) into implementation OOMs
designed for the different object languages supported in PowerDesigner.
457
Parameter
Description
Object Language
Share
Copy
Name
Code
Configure
Model Options
Lets you specify model options for the model to be generated. For example links to requirements in the origin model
are preserved, by default, in the generated model, unless
you clear the Enable Links Requirements checkbox in the
Model Options dialog box before starting the generation
458
Option
Description
Check Model
Convert Names
into Codes
Enable transformations
If you select the Check Model option, the procedure to generate an OOM
starts by checking the validity of the OOM. An OOM results when no
errors are found. You can set check options by selecting Tools Check
Model.
459
Domain
Domain
Class
Entity
Interface
Not translated
Attribute
Attribute
Identifier
Identifier
Operation
Not translated
Association
Relationship or association
Association
class
460
Dependency
Not translated
Realization
Not translated
Generalization
Inheritance
Description
BasicDataTypes
ConceptualDataTypes
AdditionalDataTypes
DefaultDataType
+ For more information on data types, see section Data types category, in
chapter Object Languages Reference Guide in the Advanced User
Documentation.
data model.
All persistent classes are generated as entities. If you set the class generation
mode (in the Persistent group box in the Detail tab of the class property
sheet) to Migrate columns, the Generated check box in the generated
entity property sheet is cleared by default.
You can also define persistent data types for class attributes and domains.
For data type persistence management, you have to take into account the
following parameters:
The data type is simple, based on standard OOM data types. If the data
type is persistent, generation keeps persistent data type in the target
model. Otherwise data type is converted to standard data type in the
target model
The data type is complex, based on a classifier. If the data type is
persistent, you can define different generation options according to what
you want to have in the target model and to the attribute multiplicity
For more information on how to use a class as a data type, see the Attaching
a classifier to a data type or a return type section in the Building Structural
Diagrams chapter.
When you apply a persistent complex data type to a class attribute or a
domain, you can define the following different generation options:
Standard data type generation
Embedded data type generation
Generating as persistent
class
462
In the Detail page of the property sheet of an attribute using a complex data
type, you have to select:
In the Detail page of the property sheet of an attribute using a complex data
type, you have to select:
The Persistent check box
Embedded in the Class Generation list
After OOM to CDM generation, all the attributes of the class used as data
type are embedded into the entity containing the attribute with complex data
type. These attributes are prefixed by the name of the attribute using the
complex data type.
Example
463
All the attributes of class Address are embedded into entity Customer and
prefixed by address which is the name of the attribute using Address as
complex data type.
Managing multiplicity for complex persistent data types
If you define a multiplicity on a class attribute with a complex data type, the
generation will reflect this multiplicity.
In the following example, attribute address in class Customer has a complex
data type based on class Address.
Generating as persistent
class
464
When the Persistent check box is selected for the attribute and the class
generation is also set to Persistent, then the attribute multiplicity becomes a
cardinality on the relationship between entities after OOM to CDM
generation.
Generating as
embedded class
When the Persistent check box is selected for the attribute and the class
generation is set to Embedded, all the attributes of the class used as data type
are embedded into the entity containing the attribute with complex data type.
Attributes are generated as many times as required by multiplicity, provided
multiplicity indicates a fixed value.
In the following example, attribute multiplicity is 0..2, so attributes will be
embedded twice:
465
Description
Name
Code
Configure Model
Options
466
values of CDM options: an option defined for the generated CDM should
respect the equivalent option of the OOM.
Equivalent options are model options found in both models. The Enforce
non-divergence option exists in both OOM and CDM.
OOM option
CDM option
4 Enforce nondivergence
4 Enforce nondivergence
Unique Code for relationships and data item has no equivalent in the OOM
and this option is not selected by default in the CDM options. However, if
you select Unique Code for relationships or data items in the CDM options,
relationships and data items will be renamed during the generation of an
OOM to a CDM.
Options with no equivalent, like Show Classes as Data Type in the OOM
without any corresponding option in a CDM, are generated using default
values found in the registry.
467
Option
Description
Check model
Save generation
dependencies
CDM/OOM
Mapping
Convert Names
into Codes
Enable transformations
468
If you select the Check Model option, the procedure to generate a CDM
starts by checking the validity of the OOM. A CDM results when no errors
are found. You can set check options by selecting Tools Check Model.
469
Domain
Domain
Class
Interface
Not translated
Attribute
Identifier
Identifier
Operation with
If the parent class is generated as a table, the operation
<<storedProcedure>>is generated as a stored procedure attached to the
table.
stereotype
The operation body is generated as a body in the
procedure definition.
The generated procedure has the same name as the
operation, however, if a name conflict occurs, a
number is added to the name of the procedure
470
OOM object
Operation with
If the parent class is generated as a table, the operation
<<storedFunction>> is generated as a stored function attached to the table.
stereotype
The operation body is generated as a body in the
function definition.
The generated function has the same name as the
operation, however, if a name conflict occurs, a
number is added to the name of the function
Association
Reference or table
Association class
Dependency
Not translated
Realization
Not translated
Generalization
Reference
For a class to become a table you need to select the Persistent check box and
define a type of generation in the Generation list in the Detail tab of the class
property sheet.
The cardinality of a class becomes the number of records of a table.
Generating from
associations
Value
Description
BasicDataTypes
AdditionalDataTypes
ConceptualDataTypes
DefaultDataType
+ For more information on data types, see section Data types category, in
chapter Object Languages Reference Guide in the Advanced User
Documentation.
Result
Nothing is generated
473
Inherited attributes
Customer inherits the attributes of the parent class in the generated PDM:
Derived class
In the generated PDM, Employee inherits from parent class and also from
derived class:
474
For more information on how to use a class as a data type, see the Attaching
a classifier to a data type or a return type section in the Building Structural
Diagrams chapter.
When you apply a persistent complex data type to a class attribute or a
domain, you can define the following different generation options:
Standard data type generation
Embedded data type generation
Abstract data type generation
Generating as persistent
class
In the Detail page of the property sheet of an attribute using a complex data
type, you have to select:
The Persistent check box
Persistent in the Class Generation list
After OOM to PDM generation, both classes become tables and a reference
is created between them. This reference contains a join linking the primary
key column in the parent table Address (this column is new, it was created
during generation) and the foreign key column in the child table Customer.
The foreign key column stands for the attribute using a complex data type in
the OOM.
For example, if you define the standard data type generation options in the
Address/Customer example, the generated PDM is the following:
475
In the Detail page of the property sheet of an attribute using a complex data
type, you have to select:
The Persistent check box
Embedded in the Class Generation list
After OOM to PDM generation, all the attributes of the class used as data
type are embedded into the table containing the attribute with complex data
type. These attributes are prefixed by the name of the attribute using the
complex data type.
For example, if you define the embedded data type generation options in the
Address/Customer example, the generated PDM is the following:
All the attributes of class Address are embedded into table Customer and
prefixed by address which is the name of the attribute using Address as
complex data type.
Generating as abstract
data type class
476
In the Detail page of the property sheet of an attribute using a complex data
type, you have to select:
477
Generating as persistent
class
478
When the Persistent check box is selected for the attribute and the class
generation is also set to Persistent, then the attribute multiplicity becomes a
cardinality on the reference between tables after OOM to PDM generation.
Generating as
embedded class
When the Persistent check box is selected for the attribute and the class
generation is set to Embedded, all the attributes of the class used as data type
are embedded into the table containing the column created for the attribute
with complex data type. Attributes are generated as many times as required
by multiplicity, provided multiplicity indicates a fixed value.
In the following example, attribute multiplicity is 0..2, so attributes will be
embedded twice:
479
When both attribute and class generation are set to Persistent, and when the
class used as data type is generated as an abstract data type, the class is
generated as an abstract data type without taking into account the
multiplicity of the generated attribute.
However, for those DBMS that support ARRAY and LIST for abstract data
types, the generation of a class into an abstract data type can reflect the
attribute multiplicity in the following way:
Multiplicity
Generated as
0..n or 1..n
Abstract data type with the LIST type (example: TABLE for
Oracle)
1..2 or 0..10
Abstract data type with the ARRAY type (example: VARRAY for Oracle)
0..1 or 1..1
480
Parameter
Description
DBMS
Share
Copy
Name
Code
Configure
Model Options
Lets you specify model options for the model to be generated. For example links to requirements in the origin model
are preserved, by default, in the generated model, unless
you clear the Enable Links Requirements checkbox in the
Model Options dialog box before starting the generation
OOM option
PDM option
4 Enforce nondivergence
4 Enforce nondivergence
Unique Code for references has no equivalent in the OOM and this option is
not selected by default in the PDM options. However, if you select Unique
481
Code for references in the PDM options, references will be renamed during
the generation of an OOM to a PDM.
Options with no equivalent, like Show Classes as Data Type in the OOM
without any corresponding option in a PDM, are generated using default
values found in the registry.
Defining PDM generation options
You can set the following general generation options:
482
Option
Description
Check Model
Save Generation
Dependencies
O/R Mapping
Convert Names
into Codes
Rebuild Triggers
When selected, allows to rebuild triggers with preservation option, after the PDM generation. Rebuild takes
place after merge if you are updating an existing PDM
Option
Description
Enable transformations
If you select the Check Model option, the procedure to generate a PDM
starts by checking the validity of the OOM. A PDM results when no errors
are found. You can set check options by selecting Tools Check Model.
Table parameters
Reference parameters
Description
Table prefix
Description
Update rule
Delete rule
483
484
Variable
Value
%REFR%
%REFNAME%
Reference name
%REFRCODE%
Reference code
%PARENT%
%PNAME%
%PCODE%
%COLUMN%
%COLNNAME%
%COLNCODE%
%KEY%
%CONSTNAME%
%KNAME%
%KCODE%
%PROLE%
You can also use the default PowerDesigner formatting variables in the
template as explained in section List of PowerDesigner formatting variables
in chapter Variables in PowerDesigner in the PDM Users Guide.
Customized naming templates reappear in the generation dialog box the next
time you open it, but are not saved in the registry thus not added to the
dropdown list of predefined templates.
For example, if you define the template %PROLE%, the name of the foreign
key will be made of the role beside the class that generated the parent table
containing the primary key. If the parent table contains multiple keys, the
foreign key names will be automatically renamed.
In the Reference groupbox, you can select the Always Use Template radio
button to always use the default or customized template for naming FK
columns, even if there is no conflict with an existing column.
Index parameters
Description
PK index
names
Key index
names
FK index
names
FK threshold
You can use the following variables in the PK index names and Key Index
Names fields:
Variable
Value
%TABLE%
%TNAME%
Table name
%TCODE%
Table code
%TLABL%
Table comment
You can use the following variables in the FK index name field. The
generated code of a variable is the code defined in the object property sheet,
it may be truncated when generated if the code contains characters not
485
Value
%REFR%
%PARENT%
%PNAME%
%PCODE%
%CHILD%
%CNAME%
%CCODE%
%PQUALIFIER%
%CQUALIFIER%
%REFRNAME%
Reference name
%REFRCODE%
Reference code
If you modify a primary key in a PDM, then regenerate the PDM from an
OOM, the modified primary key is not preserved. If you want to preserve a
modified primary key, you need to modify the identifier in the OOM before
regeneration.
486
Class
Element
Abstract class
Complex type
Attribute
Identifier
Key
Domain
Simple Type
Composition
Generalization
Association
KeyRef constraints
If the code of the generated XML model objects does not correspond to
the target language naming conventions, you can define a code naming
convention script to convert object names into codes. For more information
on conversion scripts, see section .convert_name & .convert_code macros
in chapter Managing Models of the General Features Guide.
487
You must indicate the following parameters when you generate a new XML
model:
Parameter
Description
Schema language
Share
Copy
Name
Code
Configure Model
Options
488
Option
Description
Check model
Save generation
dependencies
Option
Description
Convert names
into codes
Generate mapping
Enable transformations
489
If you select the Check model option, the procedure to generate an XML
model starts by checking the validity of the OOM. An XML model results
when no errors are found. You can set check options by selecting Tools
Check Model.
490
PART II
W ORKING WITH
L ANGUAGES
This part explains how to design, generate and reverse engineering different
object languages.
CHAPTER 12
This chapter describes how to use PowerDesigner with the Java object
language.
Topic:
page
494
495
496
JavaDoc Comments
500
506
508
509
546
Java Servlets
554
565
574
583
493
+ For information about the major topics of designing EJBs, servlets, and
JSPs, see the following sections:
Enterprise Java Beans (EJBs) v2 on page 509
Java Servlets on page 554
Java Server Pages (JSPs) on page 565
494
495
3. Click the Attributes tab, and add as many attributes as necessary. These
attributes have, by default, a data type of EnumConstant. For example, to
create an enum type that contained standard mathematical operations,
you would create four EnumConstants with the names PLUS,
MINUS, TIMES, and DIVIDE.
496
Note that, since a Java enum is a full featured class, you can also add
other kinds of attributes to it by clicking in the Data Type column and
selecting another type from the list.
4. [optional] You can create an anonymous class for an EnumConstant by
selecting its row on the Attributes tab and clicking the Properties tool to
open its property sheet. On the General tab, click the Create tool next to
the Enum class box to create the internal class.
497
The Operation enum class, with an anonymous class for each of its
EnumConstants to allow for the varied arithmetic operations, could be
represented in a class diagram as follows:
498
499
JavaDoc Comments
JavaDoc Comments
Javadoc is a tool delivered in the JDK that parses the declarations and
documentation comments in a set of Java source files and produces a
corresponding set of HTML pages describing model objects.
Javadoc comments are included in the source code of an object, immediately
before the declaration of any object, between the characters /** and */.
A Javadoc comment can contain:
A description after the starting delimiter /**. This description
corresponds to a Comment in OOM objects
Tags prefixed by the @ character
For example, in the following code preview page, you can read the tag
@author, and the comment inserted from the Comment box in the General
page of the class property sheet.
500
Javadoc
Description
Applies to
Corresponding
extended attribute
%comment%
Comment box.
If Javadoc comments are not
found, standard
comments are
reversed instead
@since
Adds a Since
heading with
the specified
since-text to
the generated
documentation
Javadoc since
@deprecated
Javadoc deprecated
@author
Adds an Author
entry
Class, interface
Javadoc author.
@version
Adds a Version
entry, usually
referring to the
version of the
software
Class, interface
Javadoc version
@see
Adds a See
Also heading
with a link or
text entry that
points to reference
Javadoc see
501
JavaDoc Comments
502
Javadoc
Description
Applies to
Corresponding
extended attribute
@return
Operation
Javadoc misc
@throws
Adds a
Throws subheading to the
generated documentation
Operation
@exception
Operation
@serialData
Documents the
types and order
of data in the
serialized form
Operation
Javadoc misc
@serialField
Documents an
ObjectStreamField component of a Serializable class
serialPersistentFields member
Attribute
Javadoc misc
@serial
Attribute
Javadoc misc
@param
Attribute
Javadoc misc
When you assign a value to a Javadoc tag, the tag and its value appear in the
code preview page of the corresponding object.
@author
@exceptions and
@throws
@exceptions and @throws are synonymous Javadoc tags used to define the
exceptions that may be thrown by an operation.
To use these tags you can proceed as follows:
From the operation property sheet, click the Implementation tab and click
the Exceptions tab to open the Exceptions page. You can type exceptions
503
JavaDoc Comments
in this page.
In the same property sheet, click the Extended Attributes tab, select the
Javadoc@exception line in the list and click the ellipsis button in the
Value column. Type values for each declared exception, do not forget to
repeat @exception or @throws before each exception.
504
When you preview the generated code, each exception is displayed with its
value:
505
507
508
EJB
509
You need Java 2 SDK Standard Edition (J2SE TM) 1.3 (final release), Java 2
SDK Enterprise Edition (J2EE TM) 1.3 (final release), a Java IDE or a text
editor. You also need a J2EE application server supporting EJB 2.0.
It is also recommended that you set up the JAVA_HOME and J2EE_HOME
system variables in your environment as follows:
In CLASSPATH:
%JAVA_HOME%\ lib;%J2EE_HOME%\ lib\ j2ee.jar;%J2EE_HOME%\ lib
In Path:
%JAVA_HOME%\ bin;%J2EE_HOME%\ bin
Entity Beans
510
Type
Definition
Entity Beans
Session Beans
(Stateful and
Stateless)
Message
Driven Beans
Entity beans are used to represent underlying objects. The most common
application for entity beans is their representation of data in a relational
database. A simple entity bean can be defined to represent a database table
where each instance of the bean represents a specific row. More complex
entity beans can represent views of joined tables in a database. One instance
represents a specific customer and all of that customers orders and order
items.
They are stateless, server side components with transactional behavior that
process asynchronous messages delivered via the Java Message Service
(JMS). Applications use asynchronous messaging to communicate by
exchanging messages that leave senders independent from receivers.
EJB properties
You can open the EJB page in the component property sheet to display the
following properties:
Property
Description
Remote interface
Local interface
Bean class
511
You can open the EJB page by right clicking the EJB component symbol
in the diagram, and selecting EJB from the contextual menu.
Previewing the
component code
You can preview the code of an EJB by clicking the Preview tab in the
component property sheet. The Preview page contains tabbed pages that
correspond to each interface and class of the EJB. You can see the relation
between an EJB and its classes and interfaces from the Preview page without
generating any file.
In the class and interface property sheets, the Preview page is a keyboard
shortcut to show what will be generated.
In the model or package property sheet, the Preview page describes the EJB
deployment descriptor file with the name of the generated EJB and its
methods. It allows you to view what will be generated.
You can use the following tools and keyboard shortcuts from the Preview
toolbar:
Tool
Description
Keyboard shortcut
S HIFT + F11
Refresh
F5
CTRL
+W
CTRL
+ F6
Showing generation
options
If you click the Show Generation Options tool, the Generation Options
dialog box is displayed. You can change generation options from this dialog
box and see the impact on the code.
Select Generation
Targets
This tool is available when at least one extended model definition flagged for
generation is linked to the model, and when it contains entries in the
Generated Files category for the current type of object. When available, it
displays the list of targets for the current object. If you add a generation
target, the corresponding tab is added to the Preview page. If you deselect a
512
generation target, the corresponding tab disappears from the Preview page.
In the Preview page, you can add and remove bookmarks at specific points
in the code and then navigate forwards or backwards from bookmark to
bookmark:
Keyboard
shortcut
CTRL
+ F2
F2
SHIFT
Description
+ F2
Note that bookmarks are not printable and are lost if you use the Refresh, or
Show Generation Options tools.
513
The EJB creation wizard lets you define the following parameters:
514
Property
Description
Name
Code
Component type
Bean class
Remote interface
Extends the javax.ejb.EJBObject interface and provides the remote client view
Local interface
Transaction
Defines what transaction support is used for the component. The transaction is important for distribution
across a network on a server. The transaction support
value is displayed in the deployment descriptor. This
information is given by the deployment descriptor to
the server when generating the component
Create symbol
Property
Description
The Transaction support groupbox contains the following values, as per the
Enterprise JavaBeans 2.0 specification from Sun Microsystems, Inc.
Transaction value
Description
Not Supported
Supports
Required
Requires New
Mandatory
Never
The EJB deployment descriptor supports transaction type for each method:
you can specify a transaction type for each method of EJB remote and local
interface.
You can define the transaction type for each method using an extended
attribute from the Profile/Operation/Extended Attributes/EJB folder of the
Java object language. If the transaction type of the operation is not specified
(it is empty), the default transaction type defined in the component is used
instead.
515
2. Type a name and code for the component and click Next.
Steps of the wizard
If you have selected classes before starting the wizard, some of the
following steps are omitted because the different names are created by
default according to the names of the selected classes.
3. Select the component type and click Next.
4. Select the Bean class name and click Next.
5. Select the remote interface and the remote home interface names and
click Next.
6. Select the local interface and the local home interface names and click
Next.
7. Select the primary key class name and click Next.
8. Select the transaction support and click Next.
9. At the end of the wizard, you have to define the creation of symbols and
diagrams.
When you have finished using the wizard, the following actions are
executed:
516
Interface
Remote view
Local view
The symbol of an interface can be moved, and the link from the EJB
component to the interface can be extended. When an interface realizes an
EJB component, the interface is necessarily visible.
Displaying the interface properties
Describes
<<EJBLocalHome>>
<<EJBLocal>>
<<EJBEntity>>
<<EJBSession>>
<<EJBMessageDriven>>
<<EJBPrimaryKey>>
Naming conventions
A naming convention is a common model option that you can define in the
Model Options dialog box. It is useful to set rules in order to enforce
predefined name formats for all the objects within a model. You can specify
naming convention for related interfaces and classes in your object language
in the Settings Namings category, available from Language Edit
Current Object Language.
518
519
You can use the Create tool beside the interface or the class name to
recreate an interface or a class if it is set to <None>.
2. Click the Properties button beside the interface or the class name box that
you want to define.
The interface or the class property sheet is displayed.
3. Select properties as required.
The interfaces and classes definitions are added to the current EJB
component definition.
You cannot create an operation from the Operations page of the component
property sheet as this page is only used to view the operations of the EJB
component. You view operations of an EJB from the Operations page in
the component property sheet
Stereotypes
You can create the following operations for CMP Entity Beans only:
EJB Create(. . . ) Method (local)
EJB Create(. . . ) Method (remote)
When you create an EJB Create(. . . ) Method (local), the method is created
in the local home interface with all the persistent attributes as parameters.
When you create an EJB Create(. . . ) Method (remote), the method is created
in the remote home interface with all the persistent attributes as parameters.
Moreover, all linked methods ejbCreate(. . . ) and ejbPostCreate(. . . ) are
created automatically in the Bean class with all the persistent attributes as
parameters. Parameters are synchronized whenever a change is applied.
Modifying an interface method
If you need to modify the methods of an interface, you can do so from the
Operations page of the interface property sheet.
Adding an operation to the Bean class
After creation of the Bean class, you may need to create a method that is
missing at this stage of the process, such as an internal method.
521
522
5. Click Apply.
The requested operation is created at the end of the list of operations in
the Bean class property sheet, and you can also verify that the new
operation is displayed in the interface operation list.
6. Click OK.
Understanding operation synchronization
Synchronization maintains the coherence of the whole model whenever a
change is applied on operations, attributes, and exceptions. Synchronization
occurs progressively as the model is modified.
Operation
synchronization
523
Example
525
526
527
The EJB deployment descriptor and the compiled Java classes of the EJBs
should be packaged in a JAR file.
528
The EJB deployment tool of the application server imports the Java classes
from the JAR file and configures the EJBs in the application server based on
the description of EJBs contained in the EJB deployment descriptor.
You can see the deployment descriptor from the Preview page of the package
or model property sheet.
or
Right-click the diagram background and select Properties from the
contextual menu.
The model property sheet is displayed.
2. Click the Preview tab.
529
Generating EJBs
The EJB generation process allows you to generate EJB source code that is
compliant with J2EE 1.3 (EJB 2.0). The code generator (Java, EJB, XML,
etc. . . ) is based on templates and macros. You can customize the generated
code by editing the Java object language from Tools Resources Object
Languages.
The following picture illustrates the overall EJB development process.
The following picture focuses on the PowerDesigner part, and highlights the
role of O/R Mapping generation. The O/R mapping can be created when
generating a PDM from an OOM or generating an OOM from a PDM.
You want to generate EJB source code for an existing database. If the
database already exists, you may want to wrap the existing database into
EJBs and use EJBs to access the database.
531
You can also use generation of EJB source code when managing persistence
of EJBs with an existing database. For example, it may be necessary to
manage the persistence of an already defined EJB with an existing database.
Since you cannot change the definition of EJB nor the database schema, you
need a manual object to relational mapping in this case.
532
If the application server does not support an O/R Mapping descriptor, the
mapping must be done manually. If the O/R mapping descriptor of your
application server is not supported yet, you can create your own by
creating a new extended model definition.
533
534
535
The EJB deployment descriptor is available from the Preview page of the
package, or the model property sheet.
You can find technical documents on other model extensions that are
available for PowerDesigner. They are located in the Printable Docs
directory of your installation.
538
Generating JARs
In order to package the EJB, the bean classes, interfaces and the deployment
descriptor are placed into a .JAR file. This process is common to all EJB
components.
You can generate .JAR files from the Tasks page of the Generation dialog
box (Language Generate Java Code).
For example, one of the task allows you to compile .JAVA files using a
compiler, to create a .JAR file including the compiled Java classes, and to
complete the .JAR file with the deployment descriptor and icons.
539
Caution
You must set the values of the commands used during generation from
General Options Variables in order to enable them. For example, you
can set the javac.exe and jar.exe executables at this location.
+ For more information on how to set these variables, see section Defining
environment variables, in chapter Using the PowerDesigner interface in the
General Features Guide .
There is no constraint over the generation of one JAR per package. Only
packages with the <<archive>> stereotype will generate a JAR when they
(or one of their descendant package not stereotyped <<archive>>) contain
one EJB.
The newly created archive contains the package and all of its
non-stereotyped descendants. The root package (that is the model) is always
considered as being stereotyped <<archive>>.
For example, if a model contains several EJB components in different
sub-packages but that none of these packages is stereotyped <<archive>>,
a single JAR is created encompassing all packages.
540
The Entity Bean EJB type is further described as an example in this section.
Attributes
541
Element
Property
<description>
Component comment
<display-name>
Component name
<ejb-name>
Component code
<home>
<remote>
<local-home
<local>
<ejb-class>
<persistence-type>
<prim-key-class>
<reentrant>
<cmp-version>
<cmp-field>
If the primary key consists in only one attribute whose data type is one of the
java.lang, the primary key class may be empty. In this case, a
<primkey-field> containing the primary key attribute code is generated.
<ejb-ref>
542
ejb-ref element
<ejb-ref-name>
<ejb-ref-type>
<home>
<remote>
<ejb-link>
<ejb-local-ref>
<ejb-ref-name>
<ejb-ref-type>
<local-home>
<local>
<ejb-link>
<relationships> example Associations between bean classes are further described as an example in
this section.
Inside the <relationships> element, each <ejb-relation> defines one
association between two bean classes.
Attributes
Property
<ejb-relation-name>
Association code
<ejb-relationship-role>
543
ejb-ref element
<ejb-relationship-rolename>
Role name
<multiplicity>
<cascade-delete>
<relationship-role-source>
This element specifies the EJB whose bean class is associated with the
current relationship role.
ejb-ref element
<ejb-name>
EJB code
<cmr-field>
<cmr-field-name>
You can click the Remove button to remove a selection from the list.
4. Select the items you want to reverse and click Open.
The Reverse Java dialog box displays the items you selected.
5. Click the Options tab to display the options page.
544
7. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
545
PowerDesigner. The new simplified model, which is only available with Java
5.0, does not entirely replace the EJB 2.1 model.
2. Specify a name for the EJB, and then click Next to go to the next screen:
547
3. Choose a type of EJB3, and then click Next to go to the next screen:
4. Choose a Bean Class. If you have not selected a class before launching
the wizard, a default class with the same name as the component will be
suggested. Otherwise the original class will be selected. Then click Next
to go to the next screen:
548
5. Choose the desired level of transaction support, and then click Next to go
to the next screen:
6. Select the appropriate checkboxes if you want to create diagrams for the
component and/or the component classifiers, and then click Finish to
instruct PowerDesigner to create them.
with the EJB3 tab, the properties of which are listed below:
Property
Description
Transaction Management
Transaction Attribute
Type
Exclude Superclass
Listeners
Mapped Name
Run-As
Declare Roles
Roles Allowed
550
Property
Description
Permit All
Description
Bean class
[session beans only] Specifies the local home interface (for earlier EJB clients).
551
Description
Initialize Method
Remove Method
Post-Construct
Post-Activate
Pre-Passivate
Pre-Destroy
Interceptor Method
Timeout Method
552
Property
Description
Transaction Attribute
Type
Roles Allowed
553
Java Servlets
Java Servlets
Servlets are programs that help in building applications that generate
dynamic Web pages (HTML, XML). Servlets are a Java-equivalent of the
CGI scripts and can be thought of as a server-side counterpart to the
client-side Java applets.
Servlets are Java classes that implement a specific interface and produce
HTML in response to GET/POST requests.
In an OOM, a servlet is represented as a component, it is linked to a servlet
class that implements the required interface and provides the servlet
implementation.
When you set the type of the component to Servlet, the appropriate servlet
class is automatically created, or attached if it already exists. The servlet
class is initialized so that operations are automatically added.
Description
Servlet class
Servlet type
HttpServlet supports the http protocol, it is the most commonly used. GenericServlet extends the servlet generic class.
User-defined implies some customization as it does not implement anything. The methods vary if you change the servlet
type value
554
+ The wizard for creation of a servlet lets you define the following
parameters:
Wizard page
Description
Name
Code
Servlet type
Servlet class
Create symbol
555
Java Servlets
2. Select a name and code for the servlet component and click Next.
Steps of the wizard
If you have selected classes before starting the wizard, some of the
following steps are omitted because the different names are created by
default according to the names of the selected classes.
3. Select a servlet type and click Next.
4. Select the servlet class name and click Next.
5. At the end of the wizard, you have to define the creation of symbols and
diagrams.
When you have finished using the wizard, the following actions are
executed:
A servlet component is created
The servlet class is created and visible in the Browser. It is named after
the original class if you have selected a class before starting the wizard
If you have not selected a class beforehand, it is prefixed after the original
default component name to preserve coherence
Any diagrams associated with the component are created or updated
556
Generating servlets
The generation process retrieves all classes used by the servlet components
to generate the servlets.
v To generate servlets
1. Select Language Generate Java Code to display the Generation dialog
box.
2. Select or browse to a directory that will contain the generated files.
3. Click the Selection tab to display the Selection page.
4. Select the objects you need in the different tabbed pages.
557
Java Servlets
558
559
Java Servlets
560
Generating WARs
You can package servlets and JSPs into a .WAR file.
You can generate .WAR files from the Tasks page of the Generation dialog
box (Language Generate Java Code).
There is no constraint over the generation of one WAR per package. Only
packages with the <<archive>> stereotype will generate a WAR when they
(or one of their descendant package not stereotyped <<archive>>) contain
561
Java Servlets
7. Click OK.
563
Java Servlets
564
Description
JSP file
File object that defines the page. You can click the Properties
tool beside this box to display the property sheet of the file
object, or click the Create tool to create a file object
Default template
To modify the default content, edit the current object language from
Language Edit Current Object Language and modify the following item:
Profile/FileObject/Criteria/JSP/Templates/DefaultContent<%is(DefaultTemplate)%>
Then create the templates and rename them as
DefaultContent<%is(<name>)%> where <name> stands for the
corresponding DefaultContent template name.
To define additional DefaultContent templates for JSPs, you have to modify
the JSPTemplate extended attribute type from Profile/Share/Extended
Attribute Types and add new values corresponding to the new templates
respective names.
+ For more information on the default template property, see the definition
of TemplateContent in section Creating a JSP with the wizard on page 566.
565
566
Wizard page
Description
Name
Code
TemplateContent
Create symbol
2. Select a name and code for the JSP component and click Next.
3. Select a JSP template and click Next.
567
4. At the end of the wizard, you have to define the creation of symbols.
When you have finished using the wizard, the following actions are
executed:
A JSP component and a file object with an extension .JSP are created and
visible in the Browser. The file object is named after the original default
component name to preserve coherence
If you open the property sheet of the file object, you can see that the
Artifact property is selected
For more information on artifact file objects, see the File object properties
in a deployment diagram section in the Building Implementation
Diagrams chapter.
You can edit the file object directly in the internal editor of
PowerDesigner, if its extension corresponds to an extension defined in the
Editors page of the General Options dialog box, and if the <internal>
keyword is defined in the Editor Name and Editor Command columns for
this extension
Generating JSPs
The generation process generates only file objects with the Artifact property
selected.
Generating JSP Web deployment descriptor
The Web deployment descriptor is an XML file, called web.XML. It is
generated in the WEB-INF directory and is independent from the application
server.
The Web application deployment descriptor is generated per package. A
WAR command available in the Tasks page of the Generation dialog box
allows you to build a Web Archive that contains the Web deployment
descriptor, in addition to all classes and file objects referenced by JSP
components. At the model level, an EAR command is also provided to
group all WAR and JAR files generated for a given model inside a single
enterprise archive. The EAR contains an additional deployment descriptor
generated per model that is called application.XML.
The Web deployment descriptor is available from the Preview page of the
package, or the model property sheet.
568
v To generate JSPs
1. Select Language Generate Java Code to display the Generation dialog
box.
2. Select or browse to a directory that will contain the generated files.
3. Click the Selection tab to display the Selection page.
4. Select the objects you need in the different tabbed pages.
569
570
571
You start reverse engineering JSPs from Language Reverse Engineer Java.
Select one of the following Java formats from the Selection page, and select
the Reverse Engineer Deployment Descriptor check box from the Options
page:
Java directories
Class directories
Archive (.JAR file)
572
7. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
573
If you work on a Java OOM created in version 9.0, the subfamily of Java is
EJB 2.0 and it supports EJB. In later versions, the subfamily of Java has
become J2EE, it supports J2EE components (servlets, JSPs and EJB).
You should use the new Java object language provided with the current
version to use J2EE components. If you had customized the Java object
language in the previous version, you have to apply these changes manually
in the new Java object language.
By default the WSDL for Java extended model definition is automatically
attached to the model when you select the Java language. This extended
model definition supports J2EE 1.3. However, if you want to support J2EE
1.4, you should use the list of extended model definitions to delete the
WSDL for Java extended model definition and import the WSDL for Java
(J2EE 1.4) extended model definition.
574
Variable
Description
Default
J2EEVERIF
verifier.bat
JAR
jar.exe
JAVA
java.exe
JAVAC
javac.exe
JAVADOC
javadoc.exe
You can also add the JAVACLASSPATH variable in this table in order to set
the Java classpath, this variable replaces the CLASSPATH environment
variable.
For. . .
Description
Java
Generate package
imports
Java
Java
Java
Java
Generates information used for reverse engineering like object identifiers (@pdoid)
that are generated as documentation tags.
If you do not want these tags to be generated, you have to set this option to False
Java
Ant
EJB
EJB
EJB
575
Options
For. . .
Description
EJB
J2EE
You can set Java generation to sort the order in which the attributes and
operations of the class in a Java class definition file are displayed. You can
sort the order according to either visibility or member type for example.
Primary sort
Visibility sort
Type sort
Generate package
imports
576
You can sort the order according to the visibility or the type.
Option
Result of selection
Visibility
Type
Result of selection
Public Private
Private
Public
None
Result of selection
Attributes
Operations
Operations
Attributes
import package1.package2.class.
The Generate package imports allows you to declare import of the whole
package, it saves time whenever many classes of the same package are
possibly referenced:
import package1.package2.*;
Description
Package compiled
classes in a JAR file
Generate Javadoc
Generates Javadoc
577
Task
Description
Calls commands for building EJB and Web component source code, running the WSCompile tool,
creating a WAR file for Web component classes
and deployment descriptor, and creating a JAR
file for Java classes and deployment descriptor
Calls commands for building EJB and Web component source code, running the WSCompile tool,
and creating a WAR file for client-side artifacts
Java executables
578
The default compiler command is the javac executable. The default run
command for the Java compiler is the java executable.
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Click the Selection tab to display the Selection page.
4. Select the objects to include in the generation from the tabbed pages at
the bottom of the page.
Select Tools
All classes of the model, including those grouped into packages, are
selected and displayed by default. You use the Select tools to the
right of the Folder Selection list to modify the selection. The Include
Sub-Packages tool allows you to include all classes located within
packages.
5. Click the Options tab to display the Options page.
6. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
7. Select a value for each required option.
8. Click the Tasks tab to display the Tasks page.
579
You can import extended model definitions to work with Ant into your
model. Each extended model definition delivered with PowerDesigner
corresponds to a specific target server; among them are EA Server,
WebLogic, and Tomcat. They are located in the Resource Files/Extended
Model Definitions directory of your installation.
Description
Username
Password
Host name
Port number
You can click the Tasks tab of the Generation dialog box, and check one or
several check boxes corresponding to Tomcat tasks. You can also preview
the entire Ant script from the Preview page of the model property sheet.
At the end of the generation, the build.xml file will be generated in the
generation directory.
Working with IDE tools for Java generation
JBuilder is a Java IDE. In PowerDesigner, you are provided with a JBuilder
extended model definition (JBuilder.xem) that allows you to create, deploy
and debug EJBs, Servlets, and JSPs. The supported version of JBuilder
Enterprise is version 7.
If you want to use JBuilder to finish the Java code, deploy and debug J2EE
components, you can generate a JBuilder project including the Web
application group, EJB group, EAR group and the configuration descriptor
for O/R mapping (for EA Server and WebLogic with EJB CMP). You can
open the project, build the entire project and deploy it.
When you import the JBuilder extended model definition into your model,
you can generate the following files:
581
File type
Description
Project file
You can preview the generated JBuilder files from the Preview page of the
model property sheet.
582
2. Select one of the following file formats from the Reverse engineer list:
Java files (.java) - Files contains one or several class definitions.
Java directories - Folders containing Java files. All the .java files,
including those contained in sub-directories will be reverse engineered.
Each sub-directory becomes a package within the model. As Java files
in the same directory are often interdependent, if you do not reverse
engineer all the files in the directory, your model may be incomplete.
583
You can choose to reverse .java source files without their code body for
visualization or comparison purposes, or to limit the size of your model
if you have a very large number of classes to reverse engineer. To do
this, select the Ignore operation body option.
5. Click OK to begin the reverse engineering process. If the model in which
you are reverse engineering already contains data, the Merge Models
dialog box will open to allow you to specify whether to control whether
existing objects will be overwritten.
584
The following Java reverse engineering options are available. Note that
some may be disabled depending on the type of Java files being reversed:
Option
Result of selection
File encoding
Ignore comments
585
Option
Result of selection
Create associations
from classifier-typed
attributes
Create symbols
Libraries
586
Specifies that reversed classifiers (classes and interfaces) will not be generated from the model. To
subsequently generate the classifier, you must select
the Generate check box in its property sheet.
After reverse
Goes to header
Beginning with /*
Begins with //
Goes to footer
587
CHAPTER 13
This chapter describes how to work with the IDL object language.
Topic:
page
590
601
602
589
PowerDesigner implementation
Inheritance between
interfaces
Readonly attribute
Local interface
Abstract interface
Interface declaration
Inner link
590
interface TestInterface {
struct TestStruct {
string member1;
};
attribute string StringA;
attribute TestInterface::TestStruct MyStructAttr;
void OperationA(inout TestStruct t, in string str);
boolean OperationB(inout TestStruct t);
};
You create a CORBA fixed data type using a class with the
<<CORBAFixed>> stereotype. When you apply the stereotype, the
following extended attributes are automatically added to the class:
digits: indicates the number of digits of the fixed-point decimal number
591
General constant
A general constant is a value defined independently of any object and likely
to be reused. To declare a CORBA constant you have to create a class with
the <<CORBAConstants>> stereotype, and then add attributes with
<<CORBAConstants>> stereotype and initial values to this class.
Interface constant
You create a constant for a selected interface by adding attributes with the
<<CORBAConstants>> stereotype and initial values to this interface.
interface screen {
const short background = blue;
const short fields = green
Typedef
You create a CORBA simple typedef using a class with the
<<CORBATypedef>> stereotype. The typedef class should be linked to a
class with the <<CORBAPrimitive>>, <<CORBAStruct>> or
<<CORBAUnion>> stereotype through a generalization link in order to
define the type of data.
592
Sequence
You create a CORBA sequence using a class with the
<<CORBASequence>> stereotype. The type of the sequence is defined in
another class linked to the sequence by an association. The UpperBound
extended attribute of the <<CORBASequence>> class is used to define
the upper bound of the sequence.
Valuetype
You create a CORBA valuetype using a class with the <<CORBAValue>>
stereotype. You can further define the valuetype using the following design
features:
Inheritance between valuetypes has to be designed as a generalization
between two valuetype classes
The interface supported by a value type is the one linked to the valuetype
class with a generalization
Members of a valuetype are linked with a composition to the valuetype
You can declare an interface inside a valuetype using an inner link
593
Custom Value
You generate a custom valuetype using a class with the
<<CORBACustomValue>> stereotype.
Custom valuetypes behave like valuetypes. See section Valuetype.
Boxed Value
You generate a boxed value using a class with the
<<CORBABoxedValue>> stereotype. Since the boxed value does not
support inheritance, or operations, you should use a class with the
<<CORBAAnonymousSequence>> stereotype to associate a boxed value
with an interface.
594
Enum
You create a CORBA enum using a class with the <<CORBAEnum>>
stereotype. You declare enum elements by adding attributes to the class with
<<CORBAEnum>> stereotype.
Struct
You create a CORBA struct type using a class with the
<<CORBAStruct>> stereotype. You can mix attribute types in the struct
class.
struct Customer {
string name_lastname;
long age;
};
You use composition links to define complex struct classes as defined in the
following example:
struct Customer {
string name_lastname;
long age;
Address references;
Customer_Category belongs;
};
595
struct A {
struct B {
short c;
long d;
} e, z;
string x;
};
Sequence in a struct
To create a sequence in a struct, you have to use the
<<CORBAAnonymousSequence>> stereotype on the sequence class.
struct Customer {
string name_lastname;
long age;
sequence< string > w;
};
Union
You create a CORBA union using a class with the <<CORBAUnion>>
stereotype. Each attribute in a union represents a case, the Case extended
attribute (in Profile\Attribute\Criteria\IDL union member\Extended
Attributes) contains the case default value.
To define the switch data type, the discriminant data type for union cases,
you have to add an attribute named <class name>_switch to the list of
union attributes.
596
597
The name of the attribute is on the association role and the case is on the
association.
Struct / Enum as switch data type
You can use an enum or a struct as switch data type using a composition
association. In this situation, the composition role is used as switch attribute
for the union.
If you do not use the composition role as switch attribute, you still have to
define a switch attribute in the Union.
Array
To create a CORBA array you have to perform the following actions:
Create a class with the <<CORBAArray>> stereotype
Link the array class with another class representing the array type (use
the <<CORBAPrimitive>> stereotype to define the type)
Define the array dimension in the Dims extended attribute of the array
class. This extended attribute is a comma-separated list of the dimensions
(integer values) of the array. It is used in place of the index<i> qualifiers
on the associationEnd specified in the CORBA profile
In the following example, array 2D_array uses string data type set to 10:
You can also use the association multiplicity when the union or struct is
linked with another class. The association role and multiplicity will become
array attributes of the union or struct classes:
struct Client {
char Name[30];
short Age[3];
European_Client European attributes[5];
};
599
interface TEX {
exception Badness2000 {
string err_msg;
};
void process_token(in string tok) raises (Badness2000);
};
struct AdminLimit {
PropertyName name;
PropertyValue value;
};
exception AdminLimitExceeded {
AdminLimit admin_property_error;
};
600
+ For more information on how to design objects for IDL generation, see
section Designing for IDL on page 590.
v To generate IDL files
1. Select Language Generate IDL-CORBA Code to display the
Generation dialog box.
2. Type a destination directory for the generated file in the Directory box.
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Select the items to include in the generation from the Selection page.
4. Click the Options tab to display the Options page.
5. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
6. Select a value for each required option.
7. Click the Tasks tab to display the Tasks page.
8. Select the required task(s).
9. Click OK to generate.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation page of the Output
window, located in the bottom part of the main window.
All IDL files are generated in the destination directory.
601
You can right-click the files to reverse engineer and select the Edit command
to view the content of your files. To use this command you have to associate
the file extension with an editor in the General Options\Editor dialog box.
The pre-processing function in IDL is not handled in this version. It has the
following effect, as shown in the example below:
When a # symbol is displayed at the beginning of a line, the reverse feature
processes both if and else values during reverse.
# IF
true
# ELSE
false
# ENDIF
Unsupported tags
602
struct bar {
fixed <8, 4> high_scale;
fixed <8, 2> low_scale;
};
struct bar {
long val;
sequence <short, 4> my_shorts;
};
typedef sequence<LinkKind>LinkKinds;
typedef [wire_marshal( wireVARIANT )]
VARIANT;
struct tagVARIANT
603
Option
Result of selection
Create symbols
Mark classifiers
not to be generated
Libraries
604
Multi-selection
CTRL
or
SHIFT
keys.
The Reverse IDL dialog box displays the items you selected.
5. Select reverse engineering options in the Options page.
6. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
605
CHAPTER 14
This chapter describes how to work with the PowerBuilder object language.
Topic:
page
608
611
614
618
607
Full-featured mapping
+ This section describes the mapping between PowerBuilder and OOM
objects for fully supported PowerBuilder objects.
Application
You design a PowerBuilder application using a class with the
<<application>> stereotype.
Application properties are defined as follow:
608
PB application property
designed as
Instance variable
Attribute
Shared variable
Static attribute
Global variable
Property
External function
Function
Operation
Event
Structure in object
Structure
You design a PowerBuilder structure using a class with the <<structure>>
stereotype.
The members of the structure are designed with class attributes.
Function
You design a PowerBuilder function using a class with the <<function>>
stereotype. This class should also contain one operation.
The structures in a function are designed with <<structure>> inner
classes linked to the class.
User object
You design a PowerBuilder user object using a class with the
<<userObject>> stereotype.
User objects properties are defined as follow:
PB user object property
designed as
Control
Instance variable
Attribute
Shared variable
Static attribute
Property
Function
Operation
Event
Structure in object
Proxy
You design a PowerBuilder proxy using a class with the
<<proxyObject>> stereotype.
Instance variables of the proxy are designed with class attributes.
Proxy functions are designed with operations.
Window
You design a PowerBuilder window using a class with the <<window>>
609
stereotype.
Window properties are defined as follow:
PB window property
designed as
Control
Instance variable
Attribute
Shared variable
Static attribute
Property
Function
Operation
Event
Structure in object
Minimal mapping
The following PowerBuilder objects do not support full-featured mapping
with PowerDesigner classes:
PowerBuilder
PowerDesigner
Query
<<query>> class
Data window
<<dataWindow>> class
Menu
<<menu>> class
Project
<<project>> class
Pipe line
<<pipeLine>> class
Binary
<<binary>> class
610
611
6. Click OK.
The current PowerBuilder version is updated.
Reverse engineering
612
5. Click OK.
The current PowerBuilder version is updated.
613
Generated objects
Some of the generated objects support a full-featured mapping with an
PowerBuilder objects, some do not
Full-featured mapping
614
<Operation signature>
<Operation comment line1>
<Operation comment line2>
<visibility>
<parameter1 name> - <parameter1 comment line1>
<parameter1 comment line2>
<parameter2 name> - <parameter2 comment>
<Return comment>
<Return comment2>
Header item
Corresponds to
FuncType
Description
Access
Arguments
Returns
User-defined
comment
Generating events
To generate a custom event handler: you have to create an operation and
set a value to the EventID extended attribute
To generate a standard event handler: you have to create an operation
and select an event value in the Language Event list in the operation
property sheet
To generate a user-defined event handler: you have to create an
operation and select the <<event>> stereotype. The Language Event
list must remain empty
When the EventID extended attribute has a value, the operation is generated
as a custom event handler, although it has a name defined in the Language
Event list or the <<event>> stereotype.
615
Generated object
Generation result
specified directory.
Classes defined in packages
sub-directories.
You will then have to import the generated objects into PowerBuilder.
v To generate objects for PowerBuilder
1. Select Language Generate PowerBuilder to display the PowerBuilder
Generation dialog box.
2. Select a model or package from the Folder Selection list.
3. Select the classes to generate from the list.
Select Tools
All classes of the model are selected and displayed by default. Use
the Select tools to the right of the Folder Selection list to modify the
selection. The Include Sub-Packages tool allows you to include all
objects located within packages.
4. Click the Options tab to display the Options tab.
5. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
616
617
Full-featured mapping
The source code of these objects is retrieved without any parsing and stored
in the class header, as displayed in the Script\Header tab of the class; it will
be used in the same way during generation.
618
If all generated keywords are found, the block will be removed and relevant
attributes will be set:
Keywords attribute
FuncType, Subroutine,
Event
Name
Description
Operation comment
Access
Visibility property
Arguments
Returns
User-defined comment
GenerateHeader
Set to True
Otherwise, the function comments are kept in the operation body and the
GenerateHeader extended attribute set to false.
Overriding attributes
When a class inherits from another class, non-private inherited attributes can
be defined as properties of the child class, allowing the user to define initial
values in the child class.
619
5. Click Close.
The attributes appear in the child class list of attributes. You can modify
their initial value in the corresponding column.
6. Click OK.
620
Option
Result of selection
Ignore operation
body
Ignore comments
Create symbols
Creates a symbol in the diagram for each object. Otherwise, reversed objects are visible only in the browser
Create inner
classes symbols
Option
Result of selection
Mark classifiers
not to be generated
Create Associations
Libraries
Reverse engineering
system libraries
621
Reverse engineering
source files
This mode allows you to select PowerBuilder object source files to reverse
engineer. The extension of the source file determines the type of the reversed
object.
You can right-click the files to reverse engineer and select the Edit command
to view the content of your files. To use this command you have to associate
622
the file extension with an editor in the General Options\Editor dialog box.
Reverse engineering
directories
4. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
624
CHAPTER 15
page
626
640
643
650
625
The Imports directive can appear at the beginning of the script of each
generated file.
You can define imports in PowerDesigner in the Script\Imports sub-tab of
the property sheet of a main object. You can type the import statement or use
the Import Folder or Import Classifier tools in the Imports sub-tab.
Options
Options appear in the generated file header. You can define the following
options for main objects:
Compare: type the value Text or Binary in the value box of the Compare
extended attribute of the generated top object
626
Explicit: select True or False in the in the value box of the Explicit
extended attribute of the generated top object
Strict: select True or False in the in the value box of the Strict extended
attribute of the generated top object
Classifiers defined directly at the model level fall into the VB .NET global
namespace.
Project
You can reverse engineer VB .NET projects when you select VB .NET
projects from the Reverse Engineer list in the Reverse Engineer VB .NET
dialog box.
Make sure you reverse engineer each project into a separate model.
Assembly properties are reverse engineered as follow:
627
PowerDesigner equivalent
Title
Description
Company
Copyright
Product
Trademark
Version
AssemblyInformationalVersion
AssemblyFileVersion
AssemblyDefaultAlias
628
VB .NET accessibility
PowerDesigner visibility
Public
Protected
Friend
Protected Friend
Private
Class
You design a VB .NET class using a class in PowerDesigner. VB .NET
classes can contain events, variables, constants, methods, constructors and
properties.
The following specific classes are also supported in PowerDesigner:
MustInherit class is equivalent to an abstract class. To design this type
of class you need to create a class and select the Abstract check box in
the General tab of the class property sheet.
629
Structure
You design a VB .NET structure using a class with the <<structure>>
stereotype. Structures can implement interfaces but do not support
inheritance; they can contain events, variables, constants, methods,
constructors, and properties.
The following structure contains two attributes and a constructor operation:
...
Public Class Point
Protected Y As Integer
Protected X As Integer
Public Sub New()
End Sub
End Class
...
Interface
You design a VB .NET interface using an interface in PowerDesigner. VB
.NET interfaces can contain events, properties, and methods; they do not
support variables, constants, and constructors.
Nested Types
You design a VB .NET nested type using an inner class or interface.
Module
You design a VB .NET module using a class with the <<Module>>
stereotype and attributes, functions, subs and events.
In the following example, you define a module Test using a class with the
<<Module>> stereotype. Test contains a function. To design this function
you have to create an operation called Main and empty the return type
property. You can then define the function body in the implementation tab of
this operation.
630
...
Public Module Test
Public Sub Main()
Dim val1 As Integer = 0
Dim val1 As Integer = val1
val2 = 123
Dim ref1 As New Class1 ()
Dim ref1 As Class1 = ref1
ref2.Value = 123
Console.WriteLine ("Value: "& val1", "& val2)
Console.WriteLine ("Refs: "&ref1.Value &", "&
ref2.Value)
End Sub
End Module
...
Enumeration
You design a VB .NET enumeration using a class with the
<<enumeration>> stereotype. The code of the class attributes is used as
enumeration values.
Data Type: You set the enumeration data type using the EnumDataType
extended attribute of the enumeration. You can type for example Byte,
Short, or Long in the value column of the extended attribute
Initial Expression: You set the enumeration Initial Expression by
defining a value in the Initial Value box of an enum attribute
631
Custom Attributes
To define custom attributes for a class, an interface, a variable, a parameter
or a method, you have to use the Custom attributes extended attribute in
PowerDesigner. You can use the Custom attributes input box to type all the
custom attributes you wish to add using the correct VB .NET syntax.
You can use the Return type custom attribute extended attribute to define
custom attributes for the return type of a property attribute or a method.
Shadows
Shadows indicates that an inherited element hides a parent element with the
same name. To design a shadows class or interface, you have to set the class
or interface Shadows extended attribute to True.
In the following example, class DialogBox inherits from class Window.
Class Window contains an inner classifier Control, and so does class
DialogBox. You do not want class DialogBox to inherit from the control
defined in Window, to do so, you have to set the Shadows extended attribute
632
...
Public Class DialogBox
Inherits Window
Public Shadows Class Control
End Class
End Class
...
Variables
You design a VB .NET variable using an attribute in PowerDesigner. The
following table summarizes the different types of VB .NET variables and
attributes supported in PowerDesigner:
VB .NET variable
PowerDesigner equivalent
ReadOnly variable
Const variable
Shared variable
Shadowing variable
WithEvents variable
Overrides variable
New variable
Data Type: You define the data type of a variable using the attribute Data
Type property
Initial Value: You define the initial value of a variable using the attribute
Initial Value property
Shadowing: To define a shadowing by name set the Shadowing extended
attribute to Shadows. To define a shadowing by name and signature set
633
Property is Changeable
On the other hand, if you modify the property changeability, operations will
reflect this change, for example, if you turn a changeable property into a
read-only property, the setter operation is automatically removed.
In the following example, class Button contains a property Caption. The
Getter operation has been removed which causes the WriteOnly keyword to
appear in the property declaration line:
634
Must override: Set the Must override extended attribute of the property
to True to express that the property in a base class must be overridden in a
derived class before it can be used
Overridable: Set the Overridable extended attribute of the property to
True to express that the property can be overridden in a derived class
Overrides: Set the Overrides extended attribute of the property to True
to express that a property overrides a member inherited from a base class
Parameters: Type a value in the value box of the Property parameters
extended attribute to specify which value of the property attribute is to be
used as parameter. In the following example, class Person contains
property attribute ChildAge. The parameter used to sort the property is
ChildName:
Method
You design a VB .NET method using an operation. Methods can be
functions or subs.
635
Shadowing
VB .NET method
PowerDesigner equivalent
Select Shadows or Overloads from the Shadowing list on the VB.NET tab of the operation
property sheet
Shared method
NotOverridable
method
Overridable method
MustOverride method
Overrides method
Method parameters
636
Method implementation
VB .NET modifier
PowerDesigner equivalent
ByVal
ByRef
Optional
ParamArray
...
Public Delegate Function ActionOccurred () As Object
...
...
Public Module Utilities
Public Delegate Function NewWorker () As Object
Public Class Worker
Public Delegate Function WorkStarted () As Object
End Class
End Module
...
Event
To define an event in VB .NET you must declare its signature. You can
either use a delegate as a type for this event or define the signature on the
event itself. Both declarations can be mixed in a class.
The delegate used as a type is represented by an attribute with the
<<Event>> stereotype. You define the delegate name using the attribute
data type.
When you define the signature on the event itself, you have to use an
operation with the <<Event>> stereotype. The signature of this operation
then becomes the signature of the event.
638
Event implementation
Event Handler
To define a VB .NET event handler you should already have an operation
with the <<event>> stereotype in your class. You then have to create
another operation, and type the name of the <<event>> operation in the
Handles extended attribute Value box.
...
Public Function Operation_2() As Object Handles Print
End Function
...
External method
You define a VB .NET external method using an operation with the
<<External>> stereotype. External methods share the same properties as
standard methods. You can also define the following specific properties for
an external method:
Alias clause: you can use the Alias name extended attribute to specify
numeric ordinal (prefixed by a @ character) or a name for an external
method
Library clause: you can use the Library name extended attribute to
specify the name of the external file that implements the external method
ANSI, Unicode, Auto modifiers used for calling the external method can
be defined using the Character set extended attribute of the external
method
639
Description
VBC
WSDL
Web Service proxy generator full path. For example, C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe
640
Options
Description
Generate VB .NET
Web Service code in
.ASMX file instead of
.VB file
Description
641
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Click the Selection tab to display the Selection tab.
4. Select the objects to include in the generation from the sub-tabs at the
bottom of the tab.
Select Tools
All classes of the model, including those grouped into packages, are
selected and displayed by default. You use the Select tools to the
right of the Folder Selection list to modify the selection. The Include
Sub-Packages tool allows you to include all classes located within
packages.
5. Click the Options tab to display the Options tab.
6. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
7. Select a value for each required option.
8. Click the Tasks tab to display the Tasks tab.
9. Select the required task(s).
10. Click OK to generate.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation tab of the Output
window, located in the bottom part of the main window.
All VB files are generated in the destination directory.
642
You can right-click the files to reverse engineer and select the Edit command
to view the content of your files. To use this command you have to associate
the file extension with an editor in the General Options\Editor dialog box.
Result of selection
File encoding
Ignore comments
Create Associations
from classifier-typed
attributes
Create symbols
643
Option
Result of selection
Libraries
644
Description
#Const
Defines a symbol
#If
#Else
If the previous #If test fails, source code following the #Else
directive will be included
#Else If
Used with the #if directive, if the previous #If test fails,
#Else If includes or exclude source code, depending on the
resulting value of its own expression or identifier
#End If
646
The list of symbols is saved in the model and will be reused when you
synchronize your model with existing code using the Synchronize with
Generated Files command.
647
5. Click Apply.
VB .NET reverse engineering with preprocessing
Preprocessing is a reverse engineering option you can enable or disable.
v To reverse engineer with preprocessing
1. Select Language Reverse engineering VB .NET.
The Reverse Engineering VB .NET dialog box is displayed.
2. Select files to reverse engineer in the Selection tab.
3. Select reverse engineering options in the Options tab.
4. Select the Enable preprocessing check box in the Preprocessing tab.
5. Select symbols in the list of symbols.
648
CTRL
or
SHIFT
keys.
The Reverse VB .NET dialog box displays the files you selected.
5. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
649
650
Property
Description
ASP file
File object that defines the page. You can click the Properties
tool beside this box to display the property sheet of the file
object, or click the Create tool to create a file object
Default template
To modify the default content, edit the current object language from
Language Edit Current Object Language and modify the following item:
Profile/FileObject/Criteria/ASP/Templates/DefaultContent<%is(DefaultTemplate)%>
Then create the templates and rename them as
DefaultContent<%is(<name>)%> where <name> stands for the
corresponding DefaultContent template name.
To define additional DefaultContent templates for ASP.NET, you have to
modify the ASPTemplate extended attribute type from
Profile/Share/Extended Attribute Types and add new values corresponding to
the new templates respective names.
+ For more information on the default template property, see the definition
of TemplateContent in section Creating an ASP.NET with the wizard on
page 652.
651
+ The wizard for creation of an ASP.NET lets you define the following
parameters:
652
Wizard page
Description
Name
Code
TemplateContent
Allows you to choose the default template of the ASP.NET file object. The TemplateContent is an extended
attribute located in the Profile/Component/Criteria/ASP
category of the C# and VB.NET object languages. If
you do not modify the content of the file object, the
default content remains (see the Contents tab of the file
object property sheet). All templates are available in
the FileObject/Criteria/ASP/templates category of the
current object language
Create symbol
2. Select a name and code for the ASP.NET component and click Next.
3. Select an ASP.NET template and click Next.
4. At the end of the wizard, you have to define the creation of symbols.
When you have finished using the wizard, the following actions are
executed:
An ASP.NET component and a file object with an extension .ASPX are
created and visible in the Browser. The file object is named after the
original default component name to preserve coherence
If you open the property sheet of the file object, you can see that the
Artifact property is selected
For more information on artifact file objects, see the File object properties
section, in the Building Implementation Diagrams chapter.
You can edit the file object directly in the internal editor of
PowerDesigner, if its extension corresponds to an extension defined in the
Editors page of the General Options dialog box, and if the <internal>
keyword is defined in the Editor Name and Editor Command columns for
this extension
653
Generating ASP.NET
The generation process generates only file objects having the Artifact
property selected.
v To generate ASP
1. Select Language Generate C# or VB.NET code to display the
Generation dialog box.
2. Select or browse to a directory that will contain the generated files.
3. Click the Selection tab to display the Selection tab.
4. Select the objects you need in the different sub-tabs.
654
655
CHAPTER 16
This chapter describes how to use PowerDesigner with the Visual Basic
2005 object language.
Topic:
page
658
659
662
666
667
669
670
672
674
676
679
681
682
683
687
657
Tool
658
Creating an Assembly
PowerDesigner supports both single-assembly and multi-assembly models.
By default, when you create a Visual Basic 2005 OOM, the model itself
represents an assembly.
v To continue with a single-assembly model
1. In the top-level diagram, insert a type or a namespace. The model will
default to a single-module assembly, with the model root representing the
assembly.
v To work with a multi-assembly model
1. In the top-level diagram, insert an assembly in any of the following ways:
Use the Assembly tool in the Visual Basic 2005 diagram Palette.
Select Model Assembly Objects to access the List of Assembly
Objects, and click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Assembly.
Note that, if these options are not available to you, then you are currently
working with a single-assembly model. See Converting a
single-assembly model to a multi-assembly model on page 659.
2. The model will default to a multimodule assembly, with each assembly
represented by a standard UML package symbol, and appearing directly
below the model in the Browser tree.
Converting a single-assembly model to a multi-assembly model
You may find that you begin by designing a single-module assembly and
then need to convert your design to accommodate a multi-module assembly.
659
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Assembly properties
Assembly property sheets contains all the standard package tabs along with
the Visual Basic 2005-specific tabs listed in the sections below.
Assembly property sheet Application tab
The Application tab contains the following properties:
Property
Description
Generate
Project File
Project Filename
Assembly
Name
Root Namespace
Output Type
Project GUID
660
Description
Title
Description
Company
Product
Copyright
Trademark
Culture
Version
File Version
GUID
COM Visible
661
662
1. In the Artifact(s) column, click the New tool. PowerDesigner will create
a new compilation unit with the name of the type and a .vb extension.
2. Click OK to return to the diagram. The compilation unit is listed in the
Browser inside the Artifacts folder, and the type is listed as belonging to
it.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
663
v To add a type to a compilation unit from the compilation unit property sheet
1. Double-click the compilation units browser entry to open its property
sheet, and then click the Objects tab.
2. Click the Add Production Objects tool to open a selection window listing
all the objects available in the model.
3. Specify objects to add to the compilation unit by selecting their
checkboxes. Note that almost any model object (including other
compilation units) can be added to a compilation unit.
4. Click OK to return to the compilation unit property sheet. The selected
objects are now listed on the Objects tab.
5. Click OK to close the compilation unit property sheet. The selected
objects are now listed beneath the compilation unit in the Browser.
You can also create a compilation unit from the property sheet of a type:
v To add a type to a compilation unit from the type property sheet
1. Double-click the types diagram symbol or browser entry to open its
property sheet, and then click the Generated Files tab.
2. In the Artifact(s) column, click the Add/Remove tool to open a selection
window listing all the compilation unit available in the model.
3. Specify the compilation units to which the type will be added by
selecting their checkboxes. Note that types can be added to multiple
compilation units. In this case, they will be generated as partial types (see
Partial Types on page 668) and you can specify in which compilation
unit each of their attributes and methods will be generated.
4. Click OK to return to the type property sheet. The selected compilation
units are now listed on the Generated Files tab.
5. Click OK to close the type property sheet. The type is now listed in the
Browser, beneath the selected compilation unit(s).
664
v To create a folder
1. Right-click the model or an existing folder within the Artifacts folder in
the Browser, and select New Artifact Folder from the contextual menu.
The property sheet of the new folder opens.
2. Specify a name for the folder, and then click OK. The new folder is listed
in the Browser.
Adding compilation units to folders
To add a compilation unit to a folder, simply drag its browser entry and drop
it onto the folder browser entry. Note that folders can contain only
compilation units and/or other folders. Thus, to place a type in the
generation folder hierarchy, you must first add it to a compilation unit.
Alternatively, you can create a new compilation unit directly in a folder by
right-clicking its browser entry, and selecting New Source from the
contextual menu.
665
Classifiers defined directly at the model level fall into the Visual Basic 2005
global namespace.
666
Description
Explicit
Shadows
Strict
Compare
667
Partial Types
Types may belong to more than one compilation unit. Partial types are
prefixed with the keyword partial, as in the following example:
public partial class Server
{
private int start;
}
In this case, you can specify to which compilation unit each field and method
will be assigned by using the Compilation Unit box on the VB tab of their
property sheets (see Field, event, and property properties on page 676).
For partial types that contain inner types, you can specify the compilation
unit to which each inner type will be assigned as follows:
v To specify the compilation unit to which an inner type belongs
1. Open the property sheet of the container type and click the Inner
Classifiers tab.
2. Click the Customize Columns and Filter tool, select the CompilationUnit
Column Heading from the selection box, and then click OK to return to
the tab. The CompilationUnit column is now displayed on the tab.
3. Click in the CompilationUnit column to reveal a list of available
compilation units, select one, and click OK to close the property sheet..
668
Description
Explicit
Shadows
Strict
Compare
669
...
Public Class Point
Protected Y As Integer
Protected X As Integer
Public Sub New()
End Sub
End Class
...
Creating a struct
You can create a struct in any of the following ways:
Use the Struct tool in the Visual Basic 2005 diagram Palette.
Select Model Struct Objects to access the List of Struct Objects, and
click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Struct.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Struct properties
Visual Basic 2005 struct property sheets contain all the standard struct tabs
along with the following properties, located on the VB tab:
670
Property
Description
Explicit
Shadows
Strict
Compare
671
...
Public Delegate Function ActionOccurred () As Object
...
...
Public Module Utilities
Public Delegate Function NewWorker () As Object
Public Class Worker
Public Delegate Function WorkStarted () As Object
End Class
End Module
...
For information about creating and working with classes, see Classes in
the Building Structural Diagrams chapter.
672
Creating a delegate
You can create a delegate in any of the following ways:
Use the Delegate tool in the Visual Basic 2005 diagram Palette.
Select Model Delegate Objects to access the List of Delegate Objects,
and click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Delegate.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Delegate properties
Visual Basic 2005 delegate property sheets contain all the standard delegate
tabs along with the following properties, located on the VB tab:
Property
Description
Explicit
Shadows
Strict
Compare
673
Creating an enum
You can create an enum in any of the following ways:
Use the Enum tool in the Visual Basic 2005 diagram Palette.
Select Model Enum Objects to access the List of Enum Objects, and
click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Enum.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Enum properties
Visual Basic 2005 enum property sheets contain all the standard enum tabs
along with the following properties, located on the VB tab:
674
Property
Description
Compare
Explicit
Shadows
Strict
675
Description
Compilation
Unit
As New
Shadowing
Default
Overriding
Property Parameters
676
677
convention when defining event handlers for your own events, but it is not
required; you can use any valid subroutine name.
Before an event handler becomes usable, you must first associate it with an
event by using either the Handles or AddHandler statement.
The WithEvents statement and Handles clause provide a declarative way of
specifying event handlers. Events raised by an object declared with
WithEvents can be handled by any subroutine with a Handles clause that
names this event. Although the Handles clause is the standard way of
associating an event with an event handler, it is limited to associating events
with event handlers at compile time.
The AddHandler and RemoveHandler statements are more flexible than the
Handles clause. They allow you to dynamically connect and disconnect the
events with one or more event handlers at run time, and they do not require
you to declare object variables using WithEvents.
Event Example
The following example shows the Button class, which contains three events:
678
Method properties
Method property sheets contain all the standard operation tabs along with
the VB tab, the properties of which are listed below:
Property
Description
Compilation
Unit
Overridable
Overrides
Handles
Shadows
Shadowing
Library
Name
Alias Name
Character
Set
Method parameters
Method implementation
VB .NET modifier
PowerDesigner equivalent
ByVal
ByRef
Optional
ParamArray
680
681
682
2. Enter a directory in which to generate the files, specify whether you want
to perform a model check, and select the appropriate target.
3. [optional] Click the Selection tab and specify the objects that you want to
generate from. By default, all objects are generated, and PowerDesigner
remembers for any subsequent generation the changes you make.
4. [optional] Click the Options tab and set any necessary generation options.
For more information, see Visual Basic 2005 Generation dialog Options
tab on page 684.
5. [optional] Click the Generated Files tab and specify which files will be
generated. By default, all objects and compilation units are generated,
683
Description
684
Option
Description
Description
685
686
Variable
Description
CSC
WSDL
Web Service proxy generator full path. For example, C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe
CTRL
or
SHIFT
The selected files or directories are displayed in the dialog box and the
base directory is set to their parent directory. You can change the base
directory using the buttons to the right of the field.
4. [optional] Click the Options tab and set any appropriate options. For
more information, see Visual Basic Reverse Engineer dialog Options
tab on page 688.
5. [optional] Click the Preprocessing tab and set any appropriate
preprocessing symbols. For more information, see Visual Basic reverse
engineering preprocessing directives on page 689.
6. Click OK to begin the reverse engineering.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
687
Description
File encoding
Ignore operation
body
Ignore comments
Create Associations
from classifier-typed
attributes
Create symbols
Libraries
688
Option
Description
Specifies that reversed classifiers (classes and interfaces) will not be generated from the model. To
generate the classifier, you must select the Generate
check box in its property sheet
689
Directive
Description
#Const
Defines a symbol
#If
#Else
If the previous #If test fails, source code following the #Else
directive will be included
#Else If
Used with the #if directive, if the previous #If test fails,
#Else If includes or exclude source code, depending on the
resulting value of its own expression or identifier
#End If
690
5. Click Apply.
PowerDesigner does not support the default namespace in a Visual Studio
project. If you define default namespaces in your projects, you should avoid
reverse engineering the entire solution. It is better to reverse engineer each
project separately.
691
CHAPTER 17
Working with C#
About this chapter
Contents
page
Designing for C#
694
Generating for C#
710
Reverse engineering C#
713
693
Designing for C#
Designing for C#
This section explains how to design the supported C# concepts in
PowerDesigner.
The using directive can appear at the beginning of the script of each
generated file.
In PowerDesigner, you can define a using directive in the Script\Imports tab
of the property sheet of a main object. You can type the using statement or
use the Import Folder or Import Classifier tools in the Imports tab.
Supported C# objects
This section develops the C# concepts supported in PowerDesigner.
694
Classifiers defined directly at the model level fall into the C# global
namespace.
Project
You can reverse engineer C# projects when you select C# projects from the
Reverse Engineer list in the Reverse Engineer C# dialog box.
Make sure you reverse engineer each project into a separate model.
Assembly properties are reverse engineered as follow:
C# assembly properties
PowerDesigner equivalent
Title
Description
Configuration
Company
Copyright
Product
695
Designing for C#
C# assembly properties
PowerDesigner equivalent
Trademark
Version
Culture
AssemblyVersionAttribute
System.CLSCompliant
AssemblyFlagsAttribute
PowerDesigner visibility
Public
Private
Protected (access limited to the containing class or types derived from the
containing class)
Protected
Internal
Protected internal
Class
You design a C# class using a class in PowerDesigner. C# classes can
contain events, variables, constants, methods, constructors, properties, and
696
indexers.
The following specific classes are also supported in PowerDesigner:
New class is used to declare a member with the same name or signature
as an inherited member. To design a new class, you have to set the class
new extended attribute to True. In the following example, class
DialogBox inherits from class Window. Class Window contains an inner
classifier Control, and so does class DialogBox. You do not want class
DialogBox to inherit from the control defined in Window, to do so, you
have to set the new extended attribute to True, in the Control class inner
to DialogBox:
{
public class DialogBox : Window
{
public new class Control
{
}
}
}
{
public abstract class Client
{
private int Name;
private int ID;
}
}
Sealed class is equivalent to a final class. To design this type of class, you
need to create a class and select the Final check box in the General tab of
the class property sheet.
697
Designing for C#
{
public sealed class SealedClass
{
private int A1;
private int A2;
}
}
Struct
You design a C# struct using a class with the <<structure>> stereotype.
A struct can implement interfaces but does not support inheritance; it can
contain events, variables, constants, methods, constructors, and properties.
The following struct contains two attributes:
{
public struct Point
{
public int New()
{
return 0;
}
private int x;
private int y;
}
}
Enumeration
You design a C# enumeration using a class with the <<enumeration>>
stereotype. The code of the class attributes is used as enumeration values.
Data Type: You set the enumeration data type using the EnumDataType
extended attribute of the enumeration. You can type for example Byte,
Short, or Long in the value column of the extended attribute
Initial Expression: You set the enumeration Initial Expression by
defining a value in the Initial Value box of an enum attribute
698
{
public enum Color : colors
{
Red,
Blue,
Green,
Max = Blue
}
}
Interface
You design a C# interface using an interface in PowerDesigner. C#
interfaces can contain events, properties, indexers and methods; they do not
support variables, constants, and constructors.
Nested Types
You design a C# nested type using an inner class or interface.
Custom Attributes
To define custom attributes for a class, an interface, a variable, a parameter
or a method, you have to use the CustomAttributes extended attribute in
PowerDesigner. You can use the CustomAttributes input box to type all the
custom attributes you wish to add using the correct C# syntax.
699
Designing for C#
Fields
You design a C# field using an attribute in PowerDesigner. The following
table summarizes the C# field modifiers supported in PowerDesigner:
C# field modifiers
PowerDesigner equivalent
Static field
New field
Unsafe field
Public field
Public visibility
Protected field
Protected visibility
Internal field
Internal visibility
Private field
Private visibility
Readonly field
Read-only changeability
Volatile field
Data Type: You define the data type of a field using the attribute Data
Type property
Initial Value: You define the initial value of a field using the attribute
Initial Value property
Property
To design a C# property you have to design an attribute with the
<<Property>> stereotype.
When you do so, another attribute with the
<<PropertyImplementation>> stereotype is automatically created, it is
displayed with an underscore sign in the list of attributes. The corresponding
getter and setter operations are also automatically created.
You can get rid of the implementation attribute.
If you remove both getter and setter operations, the attribute no longer has
the <<Property>> stereotype.
When you define a <<Property>> attribute, the attribute changeability
and the getter/setter operations are tightly related as explained in the
following table:
700
Operations
Property is Changeable
On the other hand, if you modify the property changeability, operations will
reflect this change, for example, if you turn a changeable property into a
read-only property, the setter operation is automatically removed.
In the following example, class Employee contains 2 properties. The Setter
operation has been removed for property TimeReport:
701
Designing for C#
{
public class Employee
{
private int _Function;
private int _TimeReport;
// Property Function
private int Function
{
get
{
return _Function;
}
set
{
if (this._Function != value)
this._Function = value;
}
}
// Property TimeReport
private int TimeReport
{
get
{
return _TimeReport;
}
}
}
PowerDesigner equivalent
Abstract
Extern
Override
Sealed
Unsafe
Virtual
Indexer
You design a C# indexer using an attribute with the <<Indexer>>
stereotype. Another attribute with the <<IndexerImplementation>>
stereotype is automatically created, it is displayed with an underscore sign in
the list of attributes. The corresponding getter and setter operations are also
automatically created.
702
Indexer is Changeable
On the other hand, if you modify the indexer changeability, operations will
reflect this change, for example, if you turn a changeable indexer into a
read-only indexer, the setter operation is automatically removed.
In the following example, class Person contains indexer attribute Item. The
parameter used to sort the property is String Name:.
703
Designing for C#
Parameters
C# property modifier
PowerDesigner equivalent
New
Usafe
Virtual
Override
Extern
Abstract
Sealed
Type a value in the value box of the Indexer parameters extended attribute
to specify which value of the property attribute is to be used as parameter.
Method
You design a C# method using an operation.
The following table summarizes the different methods supported in
PowerDesigner:
704
C# method
PowerDesigner equivalent
Extern
New
Virtual
Override
Unsafe
Explicit
Static
C# method
PowerDesigner equivalent
Sealed
Abstract
New
When a class inherits from another class and contains methods with identical
signature as in the parent class, the New check box is automatically selected
to make the child method prevail over the parent method.
BaseInitializer and
ThisInitializer for
constructors
The Base Initializer property in the C# tab of the operation property sheet is
used to create an instance constructor initializer of the form base. It causes
an instance constructor from the base class to be invoked.
The This Initializer property in the C# tab of the operation property sheet is
also used to create an instance constructor initializer, it causes an instance
constructor from the class itself to be invoked.
In the following example, class B inherits from class A. You define a Base
Initializer extended attribute in class B constructor, this extended attribute
will be used to initialize class A constructor:
internal class B : A
{
public B(int x, int y) : base(x + y, x - y)
{}
}
Method parameters
705
Designing for C#
Method implementation
C# modifier
PowerDesigner equivalent
[none]
ref
out
Select Out in the Parameter Type box on the parameter property sheet General tab
...
{
public delegate int ActionOccurred();
}
{
public class Worker
{
public delegate WorkStarted();
}
}
Event
You design a C# event using an attribute with the <<Event>> stereotype.
Operator method
You design a C# operator using an operation with the <<Operator>>
stereotype. Make sure the <<Operator>> operation has the Public
visibility and the Static property selected.
To define an external operator, you have to set the extern extended attribute
of the operation to True. The new, virtual and override extended attributes
are not valid for operators.
The operator token (like +, -, !, ~, or ++ for example) is the name of the
method.
707
Designing for C#
Documentation tags
To generate documentation tags, you should use the Comment box in
property sheets. You can use any documentation tag before and after
documentation, for example you can type <summary> and </summary>.
If you add a tag, the documentation is preceded by /// in the generated code.
During reverse engineering, the / signs used to identify documentation are
removed and the start and end documentation tags are automatically added.
In the following example, you add a comment to class Employee:
708
<summary>
this is documentation
this is documentation
</summary>
709
Generating for C#
Generating for C#
This section explains some of the features of the C# object language in order
to generate C# code from objects in the OOM.
Description
CSC
WSDL
Web Service proxy generator full path. For example, C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe
710
Options
Description
Generates information used for reverse engineering like object identifiers (@pdoid) that are
generated as documentation tags. If you do not
want these tags to be generated, you have to set
this option to False
Description
Generating C# files
The files generated are generated with the .cs extension. A generation log
file is also created after generation.
v To generate C# files
1. Select Language Generate C# Code to display the Generation dialog
box.
2. Type a destination directory for the generated file in the Directory box.
711
Generating for C#
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Click the Selection tab to display the Selection tab.
4. Select the objects to include in the generation from the tabs at the bottom
of the page.
Select Tools
All classes of the model, including those grouped into packages, are
selected and displayed by default. You use the Select tools to the
right of the Folder Selection list to modify the selection. The Include
Sub-Packages tool allows you to include all classes located within
packages.
5. Click the Options tab to display the Options tab.
6. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
7. Select a value for each required option.
8. Click the Tasks tab to display the Tasks tab.
9. Select the required task(s).
10. Click OK to generate.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation tab of the Output
window, located in the bottom part of the main window.
All C# files are generated in the destination directory.
712
Reverse engineering C#
You can reverse engineer C# files into an OOM.
In the Selection tab, you can select to reverse engineer files, directories or
projects.
You can also define a base directory. The base directory is the common root
directory for all the files to reverse engineer. This base directory will be used
during regeneration to recreate the exact file structure of the reverse
engineered files.
Edit source
You can right-click the files to reverse engineer and select the Edit command
to view the content of your files. To use this command you have to associate
the file extension with an editor in the General Options\Editor dialog box.
Result of selection
File encoding
Ignore comments
Create Associations
from classifier-typed
attributes
Create symbols
713
Reverse engineering C#
Option
Result of selection
Libraries
714
Reverse engineering C#
Description
#define
Defines a symbol
#undefine
#if
#elif
Used with the #if directive, if the previous #if test fails, #elif
includes or exclude source code, depending on the resulting
value of its own expression or identifier
#endif
#warning
#error
Note: #region, #endregion, and #line directives are removed from source
code.
716
717
Reverse engineering C#
5. Click Apply.
C# reverse engineering with preprocessing
Preprocessing is an option you can enable or disable when you reverse
engineer a model.
v To reverse engineer with preprocessing
1. Select Language Reverse engineering C#.
The Reverse Engineering C# dialog box is displayed.
2. Select files to reverse engineer in the Selection tab.
3. Select reverse engineering options in the Options tab.
4. Select the Enable preprocessing check box in the Preprocessing tab.
5. Select symbols in the list of symbols.
718
Reverse engineering C#
Multi-selection
CTRL
or
SHIFT
keys.
720
CHAPTER 18
This chapter describes how to use PowerDesigner with the C# 2.0 object
language.
Topic:
page
722
C# 2.0 Assemblies
723
726
C# 2.0 Namespaces
730
C# 2.0 Classes
731
C# 2.0 Interfaces
734
C# 2.0 Structs
735
C# 2.0 Delegates
737
C# 2.0 Enums
739
C# 2.0 Fields
741
C# 2.0 Methods
742
746
750
751
752
755
721
Tool
722
C# 2.0 Assemblies
An assembly is a collection of C# files that forms a DLL or executable.
PowerDesigner provides support for both:
single-assembly models, where the model represents the assembly, and
multi-assembly models, where each assembly appears directly below the
model in the Browser tree, and is modeled as a standard UML package
with a stereotype of <<Assembly>>.
Creating an Assembly
PowerDesigner supports both single-assembly and multi-assembly models.
By default, when you create a C# OOM, the model itself represents an
assembly.
v To continue with a single-assembly model
1. In the top-level diagram, insert a type or a namespace. The model will
default to a single-module assembly, with the model root representing the
assembly.
v To work with a multi-assembly model
1. In the top-level diagram, insert an assembly in any of the following ways:
Use the Assembly tool in the C# 2.0 diagram Palette.
Select Model Assembly Objects to access the List of Assembly
Objects, and click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Assembly.
Note that, if these options are not available to you, then you are
currently working with a single-assembly model. See Converting a
single-assembly model to a multi-assembly model on page 723.
2. The model will default to a multimodule assembly, with each assembly
represented by a standard UML package symbol, and appearing directly
below the model in the Browser tree.
Converting a single-assembly model to a multi-assembly model
You may find that you begin by designing a single-module assembly and
then need to convert your design to accomodate a multi-module assembly.
723
C# 2.0 Assemblies
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Assembly properties
Assembly property sheets contains all the standard package tabs along with
the C#-specific tabs listed in the sections below.
Assembly property sheet Application tab
The Application tab contains the following properties:
Property
Description
Generate
Project File
Project Filename
Assembly
Name
Root Namespace
Output Type
Project GUID
724
Description
Title
Description
Company
Product
Copyright
Trademark
Culture
Version
File Version
GUID
725
726
1. In the Artifact(s) column, click the New tool. PowerDesigner will create
a new compilation unit with the name of the type and a .cs extension.
2. Click OK to return to the diagram. The compilation unit is listed in the
Browser inside the Artifacts folder, and the type is listed as belonging to
it.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
727
v To add a type to a compilation unit from the compilation unit property sheet
1. Double-click the compilation units browser entry to open its property
sheet, and then click the Objects tab.
2. Click the Add Production Objects tool to open a selection window listing
all the objects available in the model.
3. Specify objects to add to the compilation unit by selecting their
checkboxes. Note that almost any model object (including other
compilation units) can be added to a compilation unit.
4. Click OK to return to the compilation unit property sheet. The selected
objects are now listed on the Objects tab.
5. Click OK to close the compilation unit property sheet. The selected
objects are now listed beneath the compilation unit in the Browser.
You can also create a compilation unit from the property sheet of a type:
v To add a type to a compilation unit from the type property sheet
1. Double-click the types diagram symbol or browser entry to open its
property sheet, and then click the Generated Files tab.
2. In the Artifact(s) column, click the Add/Remove tool to open a selection
window listing all the compilation unit available in the model.
3. Specify the compilation units to which the type will be added by
selecting their checkboxes. Note that types can be added to multiple
compilation units. In this case, they will be generated as partial types (see
Partial Types on page 732) and you can specify in which compilation
unit each of their attributes and methods will be generated.
4. Click OK to return to the type property sheet. The selected compilation
units are now listed on the Generated Files tab.
5. Click OK to close the type property sheet. The type is now listed in the
Browser, beneath the selected compilation unit(s).
728
v To create a folder
1. Right-click the model or an existing folder within the Artifacts folder in
the Browser, and select New Artifact Folder from the contextual menu.
The property sheet of the new folder opens.
2. Specify a name for the folder, and then click OK. The new folder is listed
in the Browser.
Adding compilation units to folders
To add a compilation unit to a folder, simply drag its browser entry and drop
it onto the folder browser entry. Note that folders can contain only
compilation units and/or other folders. Thus, to place a type in the
generation folder hierarchy, you must first add it to a compilation unit.
Alternatively, you can create a new compilation unit directly in a folder by
right-clicking its browser entry, and selecting New Source from the
contextual menu.
729
C# 2.0 Namespaces
C# 2.0 Namespaces
Namespaces restrict the scope of an objects name. Each class or other type
must have a unique name within the namespace.
PowerDesigner models namespaces as standard packages with the Use
Parent Namespace property set to false. For information about creating and
working with packages, see Defining Packages in an OOM in the Getting
Started with an OOM chapter.
In the following example, class Architect is declared in package Design
which is a sub-package of Factory. The namespace declaration is the
following:
namespace Factory.Design
{
public class Architect
{
}
}
Classifiers defined directly at the model level fall into the C# global
namespace.
730
C# 2.0 Classes
PowerDesigner models C# 2.0 classes as standard UML classes, but with
additional properties. For information about creating and working with
classes, see Classes in the Building Structural Diagrams chapter.
In the following example, class DialogBox inherits from class Window,
which contains an inner classifier Control, as does class DialogBox:
{
public class DialogBox : Window
{
public new class Control
{
}
}
}
{
public abstract class Client
{
private int Name;
private int ID;
}
}
731
C# 2.0 Classes
{
public sealed class SealedClass
{
private int A1;
private int A2;
}
}
C# Class properties
C# class property sheets contain all the standard class tabs along with the C#
tab, the properties of which are listed below:
Property
Description
Static
Sealed
New
Unsafe
Partial Types
Types may belong to more than one compilation unit. Partial types are
prefixed with the keyword partial, as in the following example:
public partial class Server
{
private int start;
}
In this case, you can specify to which compilation unit, each field and
method will be assigned, using the Compilation Unit box on the C# tab of
their property sheets (see Field properties on page 741).
For partial types that contain inner types, you can specify the compilation
unit to which each inner type will be assigned as follows:
v To specify the compilation unit to which an inner type belongs
1. Open the property sheet of the container type and click the Inner
Classifiers tab.
2. Click the Customize Columns and Filter tool, select the CompilationUnit
Column Heading from the selection box, and then click OK to return to
the tab. The CompilationUnit column is now displayed on the tab.
732
733
C# 2.0 Interfaces
C# 2.0 Interfaces
PowerDesigner models C# 2.0 interfaces as standard UML interfaces, with
additional properties. For information about creating and working with
interfaces, see Interfaces in the Building Structural Diagrams chapter.
C# interfaces can contain events, properties, indexers and methods; they do
not support variables, constants, and constructors.
C# Interface properties
C# interface property sheets contain all the standard interface tabs along
with the C# tab, the properties of which are listed below:
734
Property
Description
New
Unsafe
C# 2.0 Structs
Structs are lightweight types that make fewer demands on the operating
system and on memory than conventional classes. PowerDesigner models
C# 2.0 structs as classes with a stereotype of <<Structure>>. For
information about creating and working with classes, see Classes in the
Building Structural Diagrams chapter.
A struct can implement interfaces but does not support inheritance; it can
contain events, variables, constants, methods, constructors, and properties.
In the following example, the struct contains two attributes:
{
public struct Point
{
public int New()
{
return 0;
}
private int x;
private int y;
}
}
Creating a struct
You can create a struct in any of the following ways:
Use the Struct tool in the C# 2.0 diagram Palette.
Select Model Struct Objects to access the List of Struct Objects, and
click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Struct.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Struct properties
Struct property sheets contains all the standard class tabs along with the C#
tab, the properties of which are listed below:
735
C# 2.0 Structs
736
Property
Description
New
Unsafe
C# 2.0 Delegates
Delegates are type-safe reference types that provide similar functions to
pointers in other languages. PowerDesigner models delegates as classes with
a stereotype of <<Delegate>> with a single operation code-named
<signature>. The visibility, name, comment, flags and attributes are
specified on the class object whereas the return-type and parameters are
specified on the operation.
A type-level (class or struct) delegate is modeled either as an operation
bearing the <<Delegate>> stereotype, or as a namespace-level delegate in
which the class representing the delegate is inner to the enclosing type.
For information about creating and working with classes, see Classes in
the Building Structural Diagrams chapter.
{
public delegate int ActionOccurred();
}
Creating a delegate
You can create a delegate in any of the following ways:
Use the Delegate tool in the C# 2.0 diagram Palette.
Select Model Delegate Objects to access the List of Delegate Objects,
and click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Delegate.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
+
Delegate properties
Delegate property sheets contains all the standard class tabs along with the
C# tab, the properties of which are listed below:
737
C# 2.0 Delegates
738
Property
Description
New
Unsafe
C# 2.0 Enums
Enums are sets of named constants. PowerDesigner models enums as classes
with a stereotype of <<Enum>>. For information about creating and
working with classes, see Classes in the Building Structural Diagrams
chapter.
{
public enum Color : colors
{
Red,
Blue,
Green,
Max = Blue
}
}
Creating an enum
You can create an enum in any of the following ways:
Use the Enum tool in the C# 2.0 diagram Palette.
Select Model Enum Objects to access the List of Enum Objects, and
click the Add a Row tool.
Right-click the model or package in the Browser, and select New
Enum.
+ For general information about creating objects, see the chapter Getting
Started with PowerDesigner in the General Features Guide .
Enum properties
C# Enum property sheets contain all the standard class tabs along with the
C# tab, the properties of which are listed below:
739
C# 2.0 Enums
740
Property
Description
New
C# 2.0 Fields
PowerDesigner models C# fields as standard UML attributes. For
information about creating and working with attributes, see Attributes in
the Building Structural Diagrams chapter.
Field properties
C# Field property sheets contain all the standard attribute tabs along with the
C# tab, the properties of which are listed below:
Property
Description
Compilation
Unit
New
Unsafe
Const
Readonly
741
C# 2.0 Methods
C# 2.0 Methods
PowerDesigner models C# methods as operations. For information about
creating and working with operations, see Operations in the Building
Structural Diagrams chapter.
Method properties
Method property sheets contain all the standard operation tabs along with
the C# tab, the properties of which are listed below:
Property
Description
Compilation Unit
Extern
New
Override
Unsafe
Virtual
Scope
Base Initializer
constructor:
internal class B : A
{
public B(int x, int y) :
base(x + y, x - y)
{}
}
742
Method parameters
Property
Description
This Initializer
PowerDesigner equivalent
[none]
ref
out
params
Method implementation
Class methods are implemented by the corresponding interface operations.
To define the implementation of the methods of a class, you have to use the
To be implemented button in the Operations tab of a class property sheet,
then click the Implement button for each method to implement. The method
is displayed with the <<Implement>> stereotype.
743
C# 2.0 Methods
Operator method
You design a C# operator using an operation with the <<Operator>>
stereotype. Make sure the <<Operator>> operation has Public visibility
and the Static property selected.
To define an external operator, you have to set the extern extended attribute
of the operation to True. The new, virtual and override extended attributes
are not valid for operators.
The operator token (like +, -, !, ~, or ++ for example) is the name of the
method.
744
745
The following example shows the Button class, which contains three events:
Property example
746
{
public class Employee
{
private int _Function;
private int _TimeReport;
// Property Function
private int Function
{
get
{
return _Function;
}
set
{
if (this._Function != value)
this._Function = value;
}
}
// Property TimeReport
private int TimeReport
{
get
{
return _TimeReport;
}
}
}
Indexer example
In the following example, class Person contains indexer attribute Item. The
parameter used to sort the property is String Name:.
747
748
Property
Description
Compilation Unit
New
Unsafe
Abstract
Extern
Override
Property
Description
Sealed
Virtual
749
750
751
2. Enter a directory in which to generate the files, specify whether you want
to perform a model check, and select the appropriate target.
3. [optional] Click the Selection tab and specify the objects that you want to
generate from. By default, all objects are generated, and PowerDesigner
remembers for any subsequent generation the changes you make.
4. [optional] Click the Options tab and set any necessary generation options.
For more information, see C# Generation dialog Options tab on
page 753.
5. [optional] Click the Generated Files tab and specify which files will be
generated. By default, all objects and compilation units are generated,
and PowerDesigner remembers for any subsequent generation the
changes you make.
752
6. [optional] Click the Tasks tab and specify any additional generation tasks
to perform. For more information, see C# Generation dialog Tasks tab
on page 754.
7. Click OK to begin generation.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation tab of the Output
window, located in the bottom part of the main window.
All C# files are generated in the destination directory.
Description
753
Option
Description
Description
WSDLDotNet: Generate
Web service proxy code
754
Variable
Description
CSC
WSDL
Web Service proxy generator full path. For example, C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\wsdl.exe
CTRL
or
SHIFT
The selected files or directories are displayed in the dialog box and the
base directory is set to their parent directory. You can change the base
directory using the buttons to the right of the field.
4. [optional] Click the Options tab and set any appropriate options. For
more information, see C# Reverse Engineer dialog Options tab on
page 756.
5. [optional] Click the Preprocessing tab and set any appropriate
preprocessing symbols. For more information, see C# reverse
engineering preprocessing directives on page 757.
6. Click OK to begin the reverse engineering.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
755
Description
File encoding
Ignore operation
body
Ignore comments
Create Associations
from classifier-typed
attributes
Create symbols
Libraries
756
Option
Description
Specifies that reversed classifiers (classes and interfaces) will not be generated from the model. To
generate the classifier, you must select the Generate
check box in its property sheet
757
Directive
Description
#define
Defines a symbol
#undefine
#if
#elif
Used with the #if directive, if the previous #if test fails, #elif
includes or exclude source code, depending on the resulting
value of its own expression or identifier
#endif
#warning
#error
Note: #region, #endregion, and #line directives are removed from source
code.
Defining a C# preprocessing symbol
You can define C# preprocessing symbols in the preprocessing tab of the
reverse engineering dialog box.
Symbol names are case sensitive and must be unique. Make sure you do not
type reserved words like true, false, if, do and so on.
The list of symbols is saved in the model and will be reused when you
synchronize your model with existing code using the Synchronize with
Generated Files command.
5. Click Apply.
PowerDesigner does not support the default namespace in a Visual Studio
project. If you define default namespaces in your projects, you should avoid
reverse engineering the entire solution. It is better to reverse engineer each
project separately.
759
CHAPTER 19
This chapter describes how to work with the XML object language.
Topic:
page
762
769
771
761
Schema
Any package or model can generate an XML-Schema. You do not need to
define specific attribute or stereotype for the package or model to generate
an XML-Schema.
Complex type
In XML-Schema, a complex type allows elements in its content and may
carry attributes. Complex types can be:
Global, that is to say defined as a child of the schema element, in order to
be reused among schema elements. You design a global complex type
using a class with the <<complexType>> stereotype. In the following
example, UsAddress is a complex type with a set of attributes that specify
it:
<xsd:complexType name="UsAddress">
<xsd:element name="name" type="Name"/>
<xsd:element name="street" type="string"/>
<xsd:element name="town" type="string"/>
<xsd:element name="zip" type="Integer"/>
</xsd:complexType>
Simple type
In XML-Schema, a simple type can be a string or a decimal built into
XML-Schema, it can also be a type derived from those built-in the language.
A simple type cannot contain elements or attributes.
762
Deriving types
XML-Schema allows you to derive new types by extending or restricting
an existing type.
In PowerDesigner, you design the extension mechanism using a
generalization between two classes. The contentDerivation extended
attribute of the generalization allows you to set the type of derivation:
extension or restriction.
763
<xsd:complexType name="A">
<xsd:simpleContent>
<xsd:extension base="xsd:string">
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
Union
A <<union>> class generates a <<union>> attribute and is migrated to
specify the attribute location.
You can generate single line <union> tag as follows: <union
memberTypes={member types list}/>. You can define a value for the
extended attribute memberTypes used with simple Type attributes (either
<<simpleType>> or <<simpleAttribute>>).
764
Global element
A global element is declared as a child of the schema element; it can be
referenced in one or more declarations. You define an XML-Schema global
element using a class with the <<element>> stereotype in PowerDesigner.
You define the type of a global element using the following methods:
For a complex type, use attributes. In this case you have to set the
isComplexType extended attribute to True for attributes defined in the
<<element>> class to be generated as a complex type
<xsd:element name="customer">
<xsd:complexType>
<xsd:element name="name" type="int"/>
<xsd:element name="address" type="int"/>
</xsd:complexType>
</xsd:element>
For a simple type, set a value for the type extended attribute
<xsd:element name="Customer" type="CustomerListType"/>
Element group
An element group is declared as a child of the schema element; it can be
referenced in one or more declarations using the <<ref>> stereotype on an
association. You define an XML-Schema element group using a class with
the <<group>> stereotype in PowerDesigner.
Attribute group
An attribute group is a set of attributes. You define an XML-Schema
attribute group using a class with the <<attributeGroup>> stereotype in
PowerDesigner. All the attributes of this class should have the
<<attribute>> stereotype.
For example, the following attribute group called item gathers information
about an item in a purchase order:
<xsd:attributeGroup name="item">
<xsd:attribute name="weight" type="Integer"/>
<xsd:attribute name="shipping_method" type="Integer"/>
</xsd:attributeGroup>
Reference
A reference is a simplified declaration of an element or an attribute group
765
Sequence
XML-Schema elements can be constrained to appear in the same order as
they are declared, this is called a sequence.
In PowerDesigner, depending on the type of sequence you need to design,
you can use one of the following methods:
If all the class attributes are defined in the sequence, you should create a
class without stereotype and set the class extended attribute isSequence
to true. In the following example, all attributes of class item_sequence
are defined in the sequence:
<xsd:element name="item_sequence">
<xsd:sequence>
<xsd:element name="prodName" type="int"/>
<xsd:element name="prodID" type="int"/>
<xsd:element name="prodPrice" type="int"/>
</xsd:sequence>
</xsd:element>
If some of the class attributes do not belong to the sequence, you have to
design the following construct: create a class containing the attributes
belonging to the sequence and assign the <<sequence>> stereotype to
this class. Create another class containing the other attributes. Select the
Inner link tool in the palette and draw a link from the second class to the
<<sequence>> class:
766
By default, inner classes are generated before attributes in a class (as defined
in the Class\Template\body entry in the object language definition file).
However, you can modify generation order among class attributes using the
attribute migration feature. To do so, you should create an association from
the parent class to the <<sequence>> class, right-click the association and
select Migrate Migrate Navigable Roles. The migrated attribute can then
be moved in the list of class attributes in order to have the desired generation
order.
<xsd:element name="PurchaseOrder">
<xsd:element name="prodID" type="int"/>
<xsd:sequence>
<xsd:element name="shipTo" type="int"/>
<xsd:element name="billTo" type="int"/>
</xsd:sequence>
</xsd:element>
767
If some of the class attributes do not belong to the choice, you have to
create a class containing the attributes belonging to the choice and assign
the <<choice>>/<<all>> stereotype to this class. Create another
class containing the other attributes. Select the Inner link tool in the
palette and draw a link from the second class to the
<<choice>>>>/<<all>> class:
You can also use the attribute migration feature to modify generation
order among attributes. See Sequence paragraph for more details.
768
When you generate XML from an OOM, PowerDesigner creates one XML
file per package. The file contains the definition of each of the classes you
select to generate in the Generation dialog box. You can select any of the
classes from the model, including those that are contained within packages
or sub-packages.
Navigable associations are migrated and generated as attributes although
they do have their own definition in the object language file
Interfaces, operations, and links (dependencies, realizations and
generalizations) are not included in the generated file
769
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Select the objects to include in the generation from the tabbed pages at
the bottom of the Selection page.
4. Click the Options tab to display the Options page.
5. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
6. Select a value for each required option.
7. Click the Tasks tab to display the Tasks page.
8. Select the required task(s).
9. Click OK to generate.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation page of the Output
window, located in the bottom part of the main window.
XML files are generated in the destination directory.
770
You can right-click the files to reverse engineer and select the Edit command
to view the content of your files. To use this command you have to associate
the file extension with an editor in the General Options\Editor dialog box.
771
Supported features
772
Option
Result of selection
Create symbols
Libraries
773
774
3. According to your object language, select the .xsd, .xdr or .dtd files you
want to reverse and click Open.
Multi-selection
You select several files simultaneously using the CTRL or SHIFT keys.
The Reverse XML dialog box displays the files you selected.
4. Click OK.
A progress box is displayed. If the model in which you are reverse
engineering already contains data, the Merge Models dialog box is
displayed.
775
CHAPTER 20
This chapter describes how to work with the C++ object language.
Topic:
page
778
780
777
class A
{
public:
B* b;
protected:
private:
};
#endif
778
#if !defined(__B_h)
#define __B_h
class A;
class B
{
public:
A* a;
protected:
private:
};
#endif
This approach will not work if one of the classes is an inner class because it
is not possible to forward-declare inner classes in C++.
779
or
Click the Select a Path button to the right of the Directory box and
browse to select a directory path.
3. Select the objects to include in the generation from the tabbed pages at
the bottom of the Selection page.
Select Tools
All classes of the model, including those grouped into packages, are
selected and displayed by default. You use the Select tools to the
right of the Folder Selection list to modify the selection. The Include
Sub-Packages tool allows you to include all classes located within
packages.
4. Click the Options tab to display the Options page.
5. <optional> Select the Check Model check box if you want to verify the
validity of your model before generation.
6. Select a value for each required option.
7. Click the Tasks tab to display the Tasks page.
8. Select the required task(s).
9. Click OK to generate.
A Progress box is displayed. The Result list displays the files that you
can edit. The result is also displayed in the Generation page of the Output
window, located in the bottom part of the main window.
All C++ files are generated in the destination directory.
780
Index
A
abort on character loss in reverse engineering
439
abstract data type
476
multiplicity
480
persistent
31
abstract operation
93
access point URL
352
action
270
activity
217
alias
272
check model
421
condition
272
create
271
properties
271
state
261
tool
182
action step in use case
154
action type
220, 221
activation
187
attach message
203
create
203
create at creation of message
203
create from diagram
203
detach message
204
explicit return
189
message
187
move
205
overlap
204
procedure call
203
recursive
196
resize
206
return
203
symbol
187
tool
175
activity
214
action
217
action type
220, 221
check model
422
committee activity (OOM)
226, 252
create
216
decomposed
226
decomposed view
229
display preferences
316
drag and drop into decomposed activity
226
input parameter
218
output parameter
218
parameter
218
properties
216
sub-activities
218
tool
178, 184
activity diagram
177
activity
214
convert to decomposed activity
227
create
179
decision
242
end
240
flow
230
object node
257
OOM
177
organization unit
249
synchronization
246
UML
177
activity parameter
display preferences
316
properties
219
actor
157, 158
check model
403
create
158
display preferences
316
drag and drop in other diagram
160
implementation class
159, 393
interface
393
primary actor
157
properties
159
secondary actor
157
show symbol
160
tool
150, 170, 175
add association class
111
add package hierarchy
450
aggregation
association
102, 105
role
102
tool
16, 19
alias
781
Index
action
272
decision
244
flow
232
transition
236
ambiguous detection in Java reverse engineering 440
Analysis
generate
457
object language
448
annotation
132
assigning
132
Java
506
Ant
435
application namespace in Web service component
332
application server
538
generate O/R mapping
537
archive Java
583
argument
event
269
message
189
array
operation
93
parameter
98
artifact in file object
304
ASMX file
generate
364
preview
333, 340
ASP.NET
650
artifact file object
652
ASP file
650
create
652
create from class diagram
652
create from selected file object
652
default template
650
file object
651
generate
654
templatecontent
652
wizard
652
assembly
659, 723
assembly connector
128
check model
431
create
128
display preferences
316
properties
128
association
102, 161
add association class
111
aggregation
102, 105
782
Index
create
display preferences
duplicate
enforce non divergence
identifier
initial value
interface
migrate
model options
operation
override
properties
update using domain
attribute value
object
properties
author OOM
auto attach WSDL xem
auto-implement realized interface
auto-layout reverse engineer
AXIS EJB
AXIS RPC
73, 78
316
78
314
84
80
72
48, 473
314
77
80
73
145
62
62
63
7
574
314
438
361, 362
360
B
base directory
C# reverse engineering
VB .NET reverse engineering
bean class
add operation
begin time
message
bibliography
binary data type
bindingTemplate
bitmap data type
BMP entity bean
body of implementation operation
boolean data type
bound classifier wizard
browse for WSDL on UDDI
business rule
check model
business rule (OOM)
domain
businessEntity
businessService
byte data type
713
643
511
521
189
xiii
143
327
143
510
95
142
43
383
401
141
327
327
142
C
C++
generation
448
C#
Add and Remove methods
77
annotation
132
C# 2.0
assembly
723
class
731
compilation unit
726
custom attributes
751
delegate
737
enum
739
field
741
generating code
752
interface
734
partial type
732
reverse-engineering code
755
struct
735
C# generation option
code in .ASMX
363
generate Web service code in .ASMX
710
C# generation task
compile source files
711
generate Web service proxy code
711
C# reverse engineering
713, 715719
activate preprocessing
718
base directory
713
edit source
713
library
713
preprocessing
715
preprocessing directives
716
symbol
717
CDM
generate
460, 466
generation options
466, 467
new
466
update
466
CDM/OOM Mapping
467
changeability
105
add-only
105
changeable
105
frozen
105
check model
action
421
activity
422
actor
403
783
Index
assembly connector
association
attribute
business rule
class
class part
component
component instance
data source
decision
domain
EJB
end
event
extended link
extended object
file object
flow
generalization
generate CDM
generate PDM
identifier
input parameter
instance link
interaction reference
interface
junction point
message
node
object
object node
OOM
operation
organization unit
output parameter
package
port
realization
replication
start
state
synchronization
transition
use case
check parameter
additional
properties
784
431
431
414
401
404
430
426
428
402
423
400
524
425
421
428
428
401
425
418
467
482
411
432
419
429
411
422
419
427
418
424
400
415
424
432
403
430
417
402
425
420
425
425
403
146
147
146
standard
146
type
146
circular
dependency
403
inheritance
403
class
27, 731
association
48
association class
31
attribute
111
change to object
5961
change to object node
258, 398
change to state
396
check model
404
circular dependency
403
component
290
component diagram
290
composite
44
copy and paste in communication diagram
396
copy and paste in object diagram
61, 396
copy and paste in sequence diagram
396
copy and paste in statechart diagram
259, 396
create
27, 155, 159, 396
create an interface
55
create from an interface
28
display preferences
316
drag and drop in activity diagram
258, 398
drag and drop in communication diagram 59, 396
drag and drop in object diagram
61, 396
drag and drop in sequence diagram
396
drag and drop in statechart diagram
259, 396
EJB
517
generate PDM
471
implement interface
90
implementation
392, 393
inherited association
48
inner to
31
instantiation
391, 396
migrate attribute
48
model option
314
object node
258
operation
87
part
65
paste as shortcut in object diagram
61
persistent
31
port
68
preview code
35
properties
28
Index
realization
state
tool
Visual Basic 2005
class diagram
annotation
association
attribute
class
component
create
create a JSP
create a servlet
create an ASP.NET
create an EJB
create for component
create Web service
dependency
domain
generalization
identifier
interface
OOM
open
operation
parameter
part
port
realization
require link
servlet
UML
Web service
class part
check
class persistence
classifier
attach to data type
attach to return type
fully qualified name
interface
operation return type
parameter data type
use case
CLASSPATH
J2EE_HOME
JAVA_HOME
28, 125
396
16, 19
667
16
132
102
72
27
286
18
566
555
652
513
293
335
119
141
115
82
55
16
293
86
97
65
68
124
126
554
16
340
430
461
46
46
46
44
46
46
44
355, 574
509
509
785
Index
interface
interface operation
open class diagram
part
port
properties
related diagrams
state
stereotype
tool
transaction
type
update class diagram
view operations
Web service
component diagram
ASP.NET
class
component
create
dependency
EJB
file object
generalization
interface
JSP
OOM
part
port
servlet
UML
Web service
component instance
cardinality
check model
component instantiation
create
display preferences
instance of component
properties
tool
Web service
component type in import WSDL
composite
class
interface
composite activity
786
289
293
293
65
68
286
288
396
286
279
286
286
293
293
286
279
650
290
284
281
120
509
292
116
289
565
279
65
68
554
279
331, 338
300
301
428
397
300
316
397
301
283
301, 352
380
44
44
package
51
composite state
package
51
composite structure diagram
create
21
OOM
19
UML
19
composite view
51
node
296
composition
association
103, 105
role
103
tool
16, 19
conceptual data type
461
condition
action
272
conditional branch
244, 245
decision
244
flow
232
message
189
transition
236, 245
conditional branch
244
condition
244, 245
factorize condition
245
configure
CDM options
466
PDM options
481
constructor
add
88
default
88
operation
88
container
collection type
105
in association
102
type
108
control flow
message
186, 187, 189
convert to decomposed
227, 263
copy constructor
88
copy object language
11
create associations
reverse engineering Java
585
reverse engineering PowerBuilder
620
create in class diagram during WSDL reverse
engineering
382
create in component diagram during WSDL reverse
engineering
382
Index
D
data source
check model
data type
binary
bitmap
boolean
byte
character
conceptual
date
decimal
default
domain (OOM)
float
image
integer
model options
money
number
object language
OLE
options
parameter
serial
time
translate
undefined
Web service
data type generation multiplicity
date data type
decimal data type
402
143
143
142
142
143
461
143
142
313
141
142
143
142
314
142
142
461
143
312
46, 98
142
143
461, 471
143
339
464, 477
143
142
decision
242
alias
244
check model
423
condition
244
conditional branch
242
create
243
display preferences
316
merge
242, 245
properties
243
tool
178, 184
decomposed activity
226, 227
close
228
committee activity (OOM)
252
go up one level
228
open
228
decomposed state
261, 263
close
264
go up one level
264
open
264
decomposed view
activity
229
state
264
default
classifier in statechart diagram
181
constructor
88
data type
313
default diagram
OOM
7
package (OOM)
52
default template
ASP.NET component
650
JSP component
565
default value
parameter
98
deferred event
261
delegate
672, 737
delegation connector
130
create
130
display preferences
316
properties
131
delete rule in PDM generation option
483
dependency
119, 120
create
120
display preferences
316
properties
121
tool
16, 19, 24, 26, 150, 279, 283
dependency (component diagram)
120
787
Index
788
additional checks
business rules
check parameter
create
data type
enforce non divergence
model options
multiplicity
persistent
properties
standard checks
update attributes
duplicate operation
141
141
146
141
141
314
314
141
141, 144
141
141
145
88
E
EAServer
435
EAServer extended model definition
537
edit
source
602, 643, 713, 771
source files
622
EJB
509
bean class
511
check model
524
cmp-fields
526
cmr-fields
526
code generation
524, 526
create
513
create from a class diagram
513
create from selected class
513
create operation from bean class
520
create operation from interface
520
define class
517
define interface
517
define operation
520
generate
530
generate deployment descriptor
536
generate JAR
539
generate O/R mapping
537
generate source code
534
initialization
524, 525
linked method
523
local home interface
511
local interface
511
operation stereotype
520
persistence
532
preview
512
primary key class
511
Index
properties
511
remote home interface
511
remote interface
511
reverse engineering
540, 544
reverse options
541
source code
532
stereotype
517
synchronization
524, 525
transaction
513
version
509
wizard
513
EJB deployment descriptor
528
element
541
EJB entity bean
510
EJB message driven bean
510, 511
EJB session bean
510
stateful
511
stateless
511
EJB Web service
create
373, 374
customize
376
define Java class package
375
generate
376
Java Service Editor
378
local variable
374
preview
376
svc_ejb file
377
EJB3
546
creating
547
properties
551
EJB3 BeanClass
properties
549
EJB3 operation
properties
552
ejbCreate method
520
ejbFinder method
520
ejb-jar.XML
539
ejbPostCreate method
520
ejbSelect method
520
element in EJB deployment descriptor
541
embedded
class generation
463, 476
data type generation
462, 463, 475, 476
enable swimlane mode
249
encoding
reverse engineering
439
style in Web service component
333
end
check model
create
display preferences
properties
tool
end time
message
enforce non divergence
enterprise java bean v3.0
Enterprise Java Bean Wizard
entity/relationships
notation
OOM
entry event
enum
event
arguments
check model
create
parameter
properties
trigger event
exception
implementation operation
synchronize
use case
exit event
export
XMI file
XML
extended attribute
JMS
UDDI
extended dependencies
extended link
check model
extended model definition
CocoBase
EAServer
WebLogic
WSDL for Java
WSDL for .NET
extended object
check model
extension point in use case
240
425
240
316
240
178, 182, 184
189
314
546
547
467
460
266, 270
674, 739
266
269
421
267
266
267
266
95
524
154
266, 270
433, 434
434
334
334
323
428
321, 451
537
537
537
330
330
428
154
789
Index
F
field
741
file
create
303
display preferences
316
file encoding in reverse engineering
439
file object
303
artifact
304
ASP.NET
651
ASP.NET stereotype
651
check model
401
component
292
component diagram
292
generate
304
JSP
566
filename OOM
7
find in Browser
226, 261
FK index name in PDM generation option
485
FK threshold in PDM generation options
485
float data type
142
flow
230
alias
232
check model
425
condition
232
create
231
display preferences
316
merge model
230
parameter
232
properties
231
transformation
232
foreign key
484
generate
485
index
485
name
485
name template for generation
484
fork
246
format variable
34
fully qualified name of classifier
46
G
gate
generalization
check model
create
display preferences
properties
790
197
115, 116, 473
418
116
316
116
tool
16, 19, 26, 150, 279
generate
add package hierarchy
450
ADT
472
Analysis
457
ASMX file
363
ASP.NET
654
AXIS EJB
361, 362
AXIS RPC
360
C++
448
C#
448
C# options
710
C# tasks
711
CDM
460, 466
CDM options
467
check model
448
configure CDM options
466
configure PDM options
481
EJB
530, 534
EJB deployment descriptor
536
EJB Web service
376
file object
304
foreign key
485
foreign key name
484
IDL-CORBA
448
implementation OOM
457
index parameter
485
JAR
539
Java
448
Java BeanInfo
37
Java options
575
Java tasks
577
Java Web service
371
JavaBean
37
Javadoc
505
Javadoc comment
505
JAXM
355
JAX-RPC
356
JSP
568
JSP Web deployment descriptor
568
language
450
model
449
model options from OOM
488
.NET commands
363
.NET options
363
.NET Web services
364
new CDM
466
Index
new model
456
new OOM
457
new PDM
480
O/R mapping
537
object language
448
OOM
456, 458
OOM from OOM
457
OOM objects to XML model
487
OOM to XML model
487
package
449
PDM
470, 480, 481
PDM options
482
PowerBuilder
448
PowerBuilder options
615
preserve modifications
487
primary key
485
reference parameter
483
schema language
487
select object
449
server side code in .NET
363
servlet
557
servlet Web deployment descriptor
560
Stateless Session Bean Web
358
table
472
table parameter
483
update existing OOM
457
update model
456
using libraries
615
using source files
615
VB.NET
448
VB.NET options
640
VB.NET tasks
641
WAR
561
Web services
355
WSDL
448
XML
448
XML-DTD
769
generation
752
generation target
451
generation task
451
generation template language (GTL)
448
generic classifier specialization wizard
42
generic type
40
derivation constraint
41
generic classifier specialization wizard
42
Getter operation
77
group symbols
174
H
header operation
Hibernate
hierarchy of packages
614
435
450
I
identifier
add attributes
check model
create
properties
IDL reverse engineering
code preview
edit source
libraries
limitations
options
pre-processing
unsupported tags
IDL-CORBA
generation
ignore comments
reverse engineering Java
reverse engineering PowerBuilder
ignore operation body
reverse engineering Java
reverse engineering PowerBuilder
image data type
implement
association
Web service method
implement stereotype
class
interface
operation
realized interface
implementation
interface
Web service
Web service component
implementation class
actor
use case
implementation code
implementation operation
body
82
84
411
82
83
602, 604
10
602
603
602
603
602
602
448
585
620
585
620
143
107
344
90, 314
90
90
314
457
392, 393
335
332
108
159, 393
155, 392
95
95
95
791
Index
create
90
exception
95
exception classifier
95
post-condition
95
pre-condition
95
specification
95
implicit stereotype
104
import
extended model definition
538
interface WSDL in Web service component
instance
353
WSDL
380
XMI file
433
XML
433
include
decomposed activities tool
226
decomposed states tool
261
index
foreign key
485
generate
485
primary key
485
indicator in association
102
inheritance
80, 87, 473
circular
403
inherited attribute
72, 473, 619
inherited operation
86, 93
initial value
80
initialization
EJB
525
servlet
557
initializer
88
add
88
operation
88
inner classifier
44, 45
inner link
45
reverse engineering
438
inner link
45
inner classifier
45
tool
16, 19
inner to
class
31
input flow
fork
246
join
246
input gate
197
input parameter
218
check model
432
792
properties
instance link
check model
create
display preferences
drag and drop association
instance of association
parallel instance links
properties
sequence number
show symbols
tool
instantiation
class
component
integer data type
Integrating with Other Products
interaction activity
create
display preferences
properties
interaction fragment
create
display preferences
properties
interaction frame
display preferences
interaction overview diagram
create
flow
interaction activity
OOM
UML
interaction reference
check model
create
display preferences
properties
interface
actor
attribute
auto-implement realized interface
change to object
check model
component
component diagram
composite
219
136, 137
419
137, 138
316
136, 137, 139
399
138
139
137
138
24, 170
396
397
142
435
207
208
316
208
210
210
316
210
197
316
184
185
230
207
184
184
207
429
207
316
208
55, 669, 734
393
72, 111
314
61
411
289
289
44
Index
61
55, 155, 159
28
55
316
61
517
392, 393
314
61
35
56
55, 125
16, 19
392
335, 342
332
340
31
270
J
J2EE
J2EE application server
J2EE HOME path
J2EE_HOME
JAGTOOL
JAR
Java
annotation
auto attach WSDL xem
code
code comment
EJB 2.0
EJB subfamily
environment variable
J2EE 1.3
J2EE 1.4
JSP
script
servlet
strictfp keyword
Web service support
WSDL extended model definition
Java BeanInfo
create
509
509
509
374
374
539
132, 506
574
583
587
574
574
574
574
574
565
33
554
508
330
321
37
37
generate
Java class package
Java generation option
add Java classes code
add object ID
default accessors
generate Ant build.xml
generate CMP field
generate CMR field
generate value object class
Jar Web component classes
navigable association
primary sort
type sort
visibility sort
Java generation task
compile
create EAR
create JAR
create WAR
generate Javadoc
run J2EE verifier
run Java
JAVA HOME path
Java IDE
Java reverse engineering
class
code preview
dependency
deployment descriptor
library
options
without body code
Java Service Editor
Java Web service
create
customize
define Java class package
generate
generate for Sybase WorkSpace
Java Service Editor
preview
svc_java file
JavaBean
generate
JAVACLASSPATH
Javadoc
37
370, 375
575
575
575
575
575
575
575
575
575
575
575
575
575
577
577
577
577
577
577
577
509
509
583
583
10
583
585
585
585
583
373, 378
368
371
370
371
368
373
371
372
37
355, 374, 574
505
793
Index
author tag
comment
defining value for
deprecated tag
exception tag
misc tag
return tag
see tag
serial tag
serialData tag
serialField tag
since tag
throws tag
version tag
Javadoc comment
JAXM
JAX-RPC
JBuilder
JDK
JDO
JMS
extended attributes
join
JSP
create
create from a class diagram
create from selected file object
file object
file object artifact
generate
generate deployment descriptor
generate WAR
reverse engineering
templatecontent
wizard
JSP component
default template
JSP file object
JSR specification
junction point
check model
create
display preferences
properties
tool
justify variable
794
500
500
503
500
500
503
500
500
500
500
500
500
500
500
505
327, 335, 355
327, 335, 356
435
509
435
511
334
246
565
566
566
566
566
566
568
568
561
571
566
566
565
565
327, 335, 355
274
422
274
316
274
182
34
K
key index name in PDM generation options
keyboard shortcut preview code
485
9, 512
L
language event
library
PowerBuilder
reverse engineering Java
reverse engineering PowerBuilder
linked method
list of value from standard checks
LISTVAL check parameter
local home interface
local interface
local variable
Local2SOAP
Local2XSD
93
624
585
620
523, 524
63
147
511
511
374
339
339
M
mark classifiers
reverse engineering Java
585
reverse engineering PowerBuilder
620
merge model
flow
230
sequence diagram
174
transition
234
Merise
notation
467
OOM
460
message
186, 187
activation
187
arguments
189
asynchronous
189
begin time
189
check model
419
condition
189
control flow
186, 187, 189
Create
189, 193
create
188
create object
193
create sequence number
199
decrease sequence number
202
Destroy
189, 194
display preferences
316
end time
189
Index
gate
increase sequence number
operation
procedure call
properties
recursive
return
return value
Self-Destroy
support delay
tool
undefined
method
de-serialization
serialization
shadowing
migrate
association role
attribute
column
navigable roles in association
migrate columns
migrated
attribute
MINMAX check parameter
model
copy extended model definition
copy object language
create
diagram
options
PowerBuilder
preview code
properties
share extended model definition
share object language
model option
attribute
check
class
class attribute visibility
data type
default association container
domain (OOM)
interface
message
name/code case sensitive
197
202
399
189
188
186, 195, 196
189
189
189, 194
189, 314
170, 175
189
343
343
679
111
473
472
112
472
111
147
321
6
6
2
312
624
9
7
321
6
314
314
312, 314
314
313, 314
314
314
314
314
312
preview editable
rules
use data type full name
money data type
move generation tasks up and down
multiple
communication diagram
object diagram
multiplicity
abstract data type
association
data type generation
domain (OOM)
312
314
314
142
451
59
59
480
105
464, 477
141
N
name/code case sensitive
namespace
package (OOM)
Web service
naming convention
navigability
association
.NET
compile source files
generate server side code
generation options
generation tasks
Web service method
Web service proxy code
Web service support
WSDL extended model definition
network address
new object language version
node
check model
component deployed
component instance
composite view
create
display preferences
network address
node diagram
properties
tool
node association
create
display preferences
312
450
52
335
518
105
363
363
363
363
349
363
330
321
354
11
296
427
294
297
296
297
316
354
298
297
283
306
306
316
795
Index
properties
role
stereotype
tool
node diagram
close
create
deployment diagram
go up one level
open
notation
entity/relationships
Merise
number data type
306
306
306
283
298
299
298
298
299
298
467
467
142
O
O/R mapping
object
attribute value
change to object node
check model
class instantiation
create
display preferences
generate
instance of class
object node
properties
tool
object diagram
attribute value
create
dependency
instance link
multiple
object
OOM
UML
object language
change
compare
copy
create
data type
generate
merge
new version
796
284
59, 60
62
258
418
396
60
316
449
396
258
61
24, 170, 175
62
24
119
136
59
59
22
22
11
311
11
311
461
448
311
11
OOM
replace
replace from previous version
reverse engineering
share
object lifeline
object node
check model
class
create
display preferences
object
properties
object persistence
complex data type
simple data type
object state
tool
OLE data type
OMG
OOM
activity diagram
author
check model
class diagram
communication diagram
component diagram
composite structure diagram
create
default diagram
define environment
deployment diagram
enable transformations
extended model definition
filename
generate
generate CDM
generate PDM
generation option
interaction overview diagram
object diagram
object language
options
overview
package diagram
PDM objects
properties
7
11
11
438
11
60
257
424
258
257, 398
316
258
258
461, 472
462, 472, 475
461, 472
178, 184
143
xi, 602
177
7
400
16
168
279
19
6
7
310
282
458
321
7
456, 457
460
470
457, 458
184
22
7
312
4
25
470
7
Index
sequence diagram
statechart diagram
translate to PDM
use case diagram
validation
version
operation
abstract
Add
add
array
attribute
check model
class
component
component interface
constructor
constructor stereotype
copy constructor
create
create stereotype
default constructor
destroy stereotype
destructor
duplicate
EJB
ejbCreateMethod
ejbFinderMethod
ejbSelectMethod
final
Getter
header
implement
implementation
implements
influent object
initializer
language event
message
override
parameters
parent
properties
read-only
related diagrams
Remove
return type
172
180
470
150
400
7
86
93
77
92
93
77
415
87
293
293
88
93
88
86, 87, 399
93
88
93
88
88, 92
520
93
93
93
93
77
614
347
95
93
93
88
93
399
87, 93
345
93
93
93
95
77
46, 93, 344
Setter
static
static initializer
stereotype
storedFunction
storedProcedure
synchronize
visibility
Web service method
options
configure for generated CDM
configure for generated PDM
data type
generate
generate CDM
generate PDM
IDL reverse engineering
model
OOM
PowerBuilder
reverse engineering C#
reverse engineering EJB
reverse engineering Java
reverse engineering JSP
reverse engineering servlet
reverse engineering VB .NET
reverse engineering WSDL
reverse engineering XML
ordering
association
role
organization unit
attach activity
check model
committee activity (OOM)
create
detach activity
display preferences
open property sheet
parent organization
properties
swimlane
tool
output flow
fork
join
output gate
77
93
88
93
93
93
523
93
93
466
481
312
450
467
482
603
312
312
620
713
541
585
571
562
643
382
772
105
105
249
251
424
252
249
253
316
250
250
250
249, 250, 253
178, 184
246
246
197
797
Index
output parameter
check model
properties
override
override stereotype
attribute
class
operation
overview OOM
218
432
219
80, 87, 619
80
80, 87
87
4
P
package
check model
display preferences
tool
package (OOM)
composite view
default diagram
import WSDL
operation visibility
preview code
properties
sub-package
package diagram
create
OOM
UML
package hierarchy
parallel flow
parallel instance link
parameter
array
create
data type
default value
direction
event
flow
in a Web service method
parameter type
parent
properties
variable arguments
WSDL data type
parameter direction
In
In/Out
798
403
316
26, 150
51
51
54
380
93
9, 53
52
51
26
25
25
450
230
136
97, 218, 268
98
97
46, 98
98
98
266
232
345
98
98
98, 219
98
98
98
98
Out
98
parent
operation
93
organization in organization unit
250
part
65
create
65
display preferences
316
properties
66
partial type
C# 2.0
732
Visual Basic 2005
668
pdGenerated
109
PDM
data type
471
generate
470, 480
generate from association
471
generate from class
471
generation options
480, 482
pdoid
710
pdRoleInfo
109
persistence
461
attribute migration
473
OOM to CDM
461
OOM to PDM
472
persistent
abstract data type
31
attribute (class diagram)
462, 475
class
31
class generation
462, 475, 476
code
31
domain (OOM)
141, 144
PK index name in PDM generation options
485
port
68
check model
430
create
69
display preferences
316
properties
69
post-condition
implementation operation
95
use case
154
PowerBuilder
application
618
binary object
618
control
618
custom event handler
615
data window
618
function
618
Index
generate binary
generate dataWindow
generate menu
generate operation
generate pipeLine
generate project
generate query
libraries
library
load
menu
model
objects
open
options
overriding attribute
pipe line
project
proxy object
query
reverse engineering
reverse engineering code preview
reverse engineering directories
reverse engineering edit source files
reverse engineering using libraries
reverse engineering using source files
select version
standard event handler
structure
target/application
user object
user-defined event handler
window
PowerBuilder generation
options
select object
using libraries
using source files
pre-condition
implementation operation
use case
preprocessing
directives
enable
symbol
preserve modifications
preview
610
610
610
614
610
610
610
618
624
624
618
624
618
624
620
619
618
618
618
618
618
10
623
622
622
622
611
615
618
622
618
615
618
448
615
616
615
615
95
154
645, 715
646, 716
648, 718
646, 717
487
ASMX file
bookmark
code
editable
EJB
EJB Web service
interface WSDL
Java Web service
keyboard shortcut
package (OOM)
refresh
reverse engineering IDL
reverse engineering Java
reverse engineering PowerBuilder
select generation target
shortcut key
show generation options
Web service
Web service class
WSDL
previous version model
primary key
generate
index
name
primary key class
private operation visibility
procedure call
activation
message
recursive
procedure call message
protected operation visibility
public operation visibility
333, 340
9, 35, 512
9, 35, 512
312
512
376
340
371
9, 512
53
9, 35, 512
10
10
10
35, 512
35
9, 35, 512
333
340
380
45
485
485
485
511
93
203
189
196
175
93
93
R
realization
check model
class
create
display preferences
interface
properties
stereotype
tool
rebuild data type links
receiver
124
417
28, 125
124
316
55, 125
124, 125
125
16, 19
113
187
799
Index
recursive
activation
procedure call
recursive message
create
return
undefined
reference
foreign key name
generate
reflexive
association
flow
instance link
transition
related diagram
component
oom objects
operation
use case
remote home interface
remote interface
replace object language
replication
check model
partial replication
require link
create
display preferences
properties
return activation
return message
return recursive message
return type
operation
Web service method
reuse a message tool
reverse engineering
auto-layout
.class
code
EJB
EJB deployment descriptor
encoding
file encoding
into an existing OOM
.jar
800
196
196
186
195
196
196
484
483
102
230
136
234
390
288
390
95
156, 160
511
511
11
402
402
126
126
316
126
203
175, 189
196
46, 93
344
187
438
438
583
583
540, 544
541
439
439
443
583
.java
Javadoc comment
JSP
JSP deployment descriptor
new OOM
object language
PowerBuilder
servlet
servlet deployment descriptor
synonym creation
target/application
Visual Basic 2005
Web service
XML-DTD
XML-Schema
.zip
reverse-engineering code
role
aggregation
association
composition
migrate from association
node association
ordering
RULES check parameter
583
505
571
571
441
438
622
562
562
438
622
687
380
771
772
583
755
102
102, 104, 105
103
111
306
105
147
S
save generation dependencies
generate CDM
PDM generation option
script
class
customize
interface
Java
toolbar
search WSDL
select classifier
select generation targets tool
self call message
self message
self return message
Self-Destroy
message
Self-Destroy message
sender
sequence diagram
467
482
33
33
33
33
33
383
46
35, 512
175
175
175
189
194
187
Index
activation
actor
create
create communication diagram
gate
interaction fragment
interaction frame
interaction reference
merge models
message
object
object lifeline
OOM
UML
sequence number
create in communication diagram
decrease in communication diagram
increase in communication diagram
insert
instance link
message
move
serial data type
serialization class for Web service class
servlet
class
component
create
create from class diagram
create from selected class
generate
generate deployment descriptor
generate WAR
initialization
reverse engineering
synchronization
type
Web service
wizard
servlet type
genericservlet
httpservlet
user-defined
Setter operation
share object language
shortcut
generated as child table
187
158
174
170
197
210
172
207
174
187
60
60
172
172
186
199
202
202
201
137
186
200
142
340
554
554
554
555
555
555
557
560
561
557
562
557
554
335
555
555
555
555
77
11
403
shortcut key
preview code
35
show
actor symbol
160
classes as data type
312
simple data type
461, 472
SOAP
327
SOAP extension class
343
Web service operation
343
SOAP fault in WSDL schema
350
SOAP input in WSDL schema
350
SOAP output in WSDL schema
350
sorted association
105
specialized class
40
specification in implementation operation
95
standard
component Web service
335
data type generation
462
event handler
615
standard check
domain (OOM)
141
list of values
63
standard data type generation
462, 475
start
238
check model
425
create
238
display preferences
316
properties
238
tool
178, 182, 184
state
259
action
261
check model
420
class
396
component
396
create
259
decomposed
261
decomposed view
264
deferred events
261
display preferences
316
drag and drop in decomposed state
261
properties
260
sub-states
261
tool
182
transition
259
use case
396
state machine UML
180
statechart diagram
180
801
Index
action
convert to decomposed state
create
default classifier
event
junction point
OOM
parameter
start
state
transition
UML
stateless session bean
Web service
Stateless Session Bean Web
static initializer
add
operation
static operation
stereotype
association
component
EJB
implicit
node association
operation
package (OOM)
realization
storedFunction
storedProcedure
strictfp keyword
struct
sub-activity
sub-class generalization
sub-package hierarchy (OOM)
sub-state
super class
super class generalization
support delay
message
svc_ejb file
svc_java file
swimlane
attach activity
change orientation
copy and paste
detach activity
802
270
263
182
181
266
274
180
268
238
259
234
180
335
358
88
88
88
93
104
286
517
104
306
93
52
125
93
93
508
670, 735
218
115
51
261
62
115
189, 314
377
372
251
255
254
253
move
organization unit
resize
select symbol
UML
Sybase WorkSpace
create EJB Web service
create Java Web service
generate Java Web service
Sybase Workspace
Java Service Editor
symbol in preprocessing directives
synchronization
check model
create
EJB
exception
horizontal symbol
operation
properties
servlet
tool
vertical symbol
synchronize
code editor
generated file
model
synonym creation in reverse engineering
syntax variable
254
249, 253
255
253
249
373
368
368
373
646, 717
246
425
246
525
524
246
523
247
557
178, 184
246
444
444
444
438
34
T
table
generate
483
prefix
483
target model
585, 603, 620, 643, 713, 772
target namespace
prefix
333
Web service component
333
Web service component instance
353
templatecontent
ASP.NET
652
JSP
566
test .NET Web services
366
time data type
143
tModel
327
Tomcat
435
trace mode
448
Index
transaction
component
EJB
type
transformation
flow
transition
alias
check model
condition
create
display preferences
event arguments
link to event
merge model
operation
operation arguments
properties
tool
trigger action
trigger event
translate
data type
PDM objects
trigger action in flow
trigger action in transition
trigger event
action
event
transition
typographic convention
286
513
513
232
234
236
425
236, 245
235
316
236
234
234
236
236
235
178, 182, 184
236
236
461, 471
470
230
234, 236
270
270
266
234, 236
xiii
U
UDDI
extended attributes
operator URL
version
UML
activity diagram
class diagram
communication diagram
component diagram
composite structure diagram
interaction overview diagram
object diagram
OMG
package diagram
327
334
383
383
177
16
168
279
19
184
22
xi
25
sequence diagram
specification
state machine
statechart diagram
swimlane
terminology
use case diagram
version
UML Profile for CORBA
undefined recursive message
unordered association
update
PDM
update class diagram of component
use case
action step
change to state
check model
class implementation
copy and paste in statechart diagram
create
display preferences
drag and drop in statechart diagram
exception
extension point
implementation class
interface
post-condition
pre-condition
properties
related diagrams
state
tool
use case association
create
properties
use case diagram
actor
association
create
dependency
generalization
OOM
UML
use data type full name
use external WSDL
Web service component
172
xi
180
180
249
xi
150
xi
602
196
105
483
293
153
154
396
403
391
259, 396
153
316
259, 396
154
154
155, 392
392
154
154
153
156, 160
396
150
161
162
150
157
161
151
119
115
150
150
314
332
803
Index
352
46
615
V
validation
OOM
400
varargs
98
variable
CLASSPATH
355, 574
creating
224
format
34
Java
574
JAVACLASSPATH
355, 574
justify
34
properties
225
reading
224
syntax
34
writing to
224
variable arguments
parameter
98
VB .NET reverse engineering
643, 645, 646, 648
activate preprocessing
648
base directory
643
edit source
643
libraries
643
preprocessing
645
preprocessing directives
646
symbol
646
VB.NET
annotation
132
compile source files
641
generate Web service proxy class
641
VB.NET generate
448
VB.NET generation option
generate code in .ASMX
363, 640
VB.shadowing
679
version
EJB 2.0
509
OOM
7
version of PowerBuilder
611
visibility
association
105
operation
93
Visual Basic 2005
assembly
659
class
667
804
code generation
compilation unit
custom attributes
delegate
enum
interface
introduction
partial type
reverse engineering
struct
683
662
682
672
674
669
658
668
687
670
W
WAR
Web service
class diagram
component
component diagram
component instance
create
create from class diagram
create from selected class
create in component diagram
data type
deploy in .NET
deployment descriptor
deployment diagram
generate client side code
generate EAR
generate for Sybase WorkSpace
generate in .NET
generate JAR
generate WAR
implementation
implementation class
interface
Java Service Editor
namespace
node
OOM
port type
preview
properties
reverse engineering
test in .NET
type
wizard
XSD data type
561
326
340
286
331
352
335, 368, 373
335
335
338
339
364, 366
355
352
355
355
368
364
355
355
327
335
342
373, 378
335
354
326
342
333
331
380
366
332, 335
335
339
Index
.NET
WSDL for Java extended model definition
WSDL for .NET extended model definition
WSDL schema
SOAP fault
SOAP input
SOAP output
Web service component
WSDL URL
import WSDL
Web service component
Web service component instance
WSDL2Local
321
330
330
350
350
350
333
380
332
352
339
X
XMI
save as XML
saved as XML
XMI file
export
import
XML
export
import
objects
XML generation
XML model generated from OOM
XML reverse engineering
edit source
library
XML-DTD
XML-DTD generate
XML-Schema
434
433
433, 434
433
434
433
771
448
487
771, 774
771
772
771
769
772
805