Class Properties

You can modify an object's 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.

The General tab contains the following properties:

Property

Description

Name

Specifies the name of the item, which should be clear and meaningful, and should convey the item's purpose to non-technical users.

Code

Specifies the technical name of the object, which is used for generating code or scripts.

Comment

Descriptive comment for the object.

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.

Stereotype

Extends the semantics of the object beyond the core UML definition. The following common stereotypes are available by default:
  • <<actor>> - Coherent set of roles that users play

  • <<enumeration>> - List of named values used as the range of an attribute type

  • <<exception>> - Exception class, mainly used in relation to error messages

  • <<implementationClass>> - Class whose instances are statically typed. Defines the physical data structure and methods of a class as implemented in traditional programming languages

  • <<process>> - Heavyweight flow that executes concurrently with other processes

  • <<signal>> - Specification of asynchronous stimulus between instances

  • <<metaclass>> - a metaclass of some other class

  • <<powertype>> - a metaclass whose instances are sub-classes of another class

  • <<thread>> - Lightweight flow that executes concurrently with other threads within the same process. Usually executes inside the address space of an enclosing process

  • <<type>> - Abstract class used to specify the structure and behavior of a set of objects but not the implementation

  • <<utility>> - Class that has no instances

Other language-specific stereotypes may be available if they are specified in the object language file (see "Stereotypes (Profile)" in Chapter 2, DBMS Resource File Reference in Customizing and Extending PowerDesigner .

Visibility

Specifies the visibility of the object, how it is seen outside its enclosing namespace. When a class is visible to another object, it may influence the structure or behavior of the object, and/or be affected by it. You can choose between:
  • Private – only to the object itself

  • Protected – only to the object and its inherited objects

  • Package – to all objects contained within the same package

  • Public – to all objects (option by default)

Cardinality

Specifies the number of instances a class can have. You can choose between:
  • 0..1 – None to one

  • 0..* – None to an unlimited number

  • 1..1 – One to one

  • 1..* – One to an unlimited number

  • * – Unlimited number

Type

Allows you to specify that a class is a generic type, or that it is bound to one. You can choose between:
  • Class

  • Generic

  • Bound – an additional list is displayed, which lets you specify the generic type to which the class is bound. Use the tools to the right of the list to create, browse for, or view the properties of the currently selected type.

If you specify either Generic or Bound, then the Generic tab is displayed, allowing you to control the associated type variables. For more information on generic types and binding classes to them, see Generic Types and Methods.

Abstract

Specifies that the class cannot be instantiated and therefore has no direct instances.

Final

Specifies that the class cannot have any inherited objects.

Generate code

Specifies that the class is included when you generate code from the model, it does not affect inter-model generation.

Detail Tab

The Detail tab contains a Persistent groupbox whose purpose is to define the persistent generated code of a class during OOM to CDM or PDM generation, and which contains the following properties:

Property

Description

Persistent

Specifies that the class must be persisted in a generated CDM or PDM. You have to select one of the following options:
  • Generate table - the class is generated as an entity or table.

  • Migrate columns – [PDM only] the class is not generated, and its attributes and associations are migrated to the generated parent or child table.

  • Generate ADT – [PDM only] the class is generated as an abstract data type. See "Abstract Data Types", in the Building Physical Diagrams chapter of the Data Modeling guide.

  • Value Type – the class is not generated, and its attributes are generated in their referencing types.

For more information, see Managing Object Persistence During OOM to PDM Generation.

Code

Specifies the code of the table or entity that will be generated from the current class in a CDM or PDM model. Persistent codes are used for round-trip engineering: the same class always generates the same entity or table with a code compliant with the target DBMS.

Example: to generate a class Purchaser into a table PURCH, type PURCH in the Code box.

Inner to

Specifies the name of the class or interface to which the current class belongs as an inner classifier

Association class

Specifies the name of the association related to the class to form an association class. The attributes and operations of the current class are used to complement the definition of the association.

For information about additional properties available if the class is a Web service implementation class, see Web Service Implementation Class Properties

The following tabs are also available:
  • Attributes - lists and lets you add or create attributes (including accessors) associated with the class (see Attributes (OOM)). Click the Inherited button to review the public and protected attributes inherited from a parent class.

  • Identifiers - lists and lets you create identifiers associated with the class (see Identifiers (OOM)).

  • Operations - lists and lets you add or create operations associated with the class (see Operations (OOM)).

  • Generic - lets you specify the type parameters of a generic class or values for the required type parameters for a class that is bound to a generic type (see Generic Types and Methods

  • Ports - lists and lets you create ports associated with the class (see Ports (OOM)).

  • Parts - lists and lets you create parts associated with the class (see Parts (OOM)).

  • Associations - lists and lets you create associations associated with the class (see Associations (OOM)).

  • Inner Classifiers - lists and lets you create inner classes and interfaces associated with the class (see Composite and Inner Classifiers).

  • Related Diagrams - lists and lets you add model diagrams that are related to the class (see "Specifying Diagrams as Related Diagrams" in Chapter 5, Diagrams, Matrices, and Symbols in the Core Features Guide.

  • Script - lets you customize the class creation script (see Customizing Object Creation Scripts)

  • Preview - lets you view the code to be generated for the class (see Previewing OOM Code)