Attribute Properties

You can modify an object's properties from its property sheet. To open an attribute property sheet, double-click its Browser entry in the Attributes folder.

The General tab contains the following properties:

Property

Description

Parent

Specifies the classifier to which the attribute belongs.

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.

Stereotype

Extends the semantics of the object beyond the core UML definition.

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, or similarly, the other object can affect the properties of the class. You can choose between:
  • Private – only to the class to which it belongs

  • Protected – only to the class and its derived objects

  • Package – to all objects contained within the same package

  • Public – to all objects (option by default)

Data type

Set of instances sharing the same operations, abstract attributes, relationships, and semantics.

Multiplicity

Specifies the range of allowable number of values the attribute may hold. You can choose between:
  • 0..1 – zero or one

  • 0..* – zero to unlimited

  • 1..1 – exactly one

  • 1..* – one to unlimited

  • * – none to unlimited

You can change the default format of multiplicity from the registry.
HKEY_CURRENT_USER\Software\Sybase\PowerDesigner 12\ModelOptions\Cld
MultiplicityNotation = 1 (0..1) or 2 (0,1)

Array size

Specifies multiplicity in the syntax of a given language, when attribute multiplicity cannot express it. For example, you can set array size to [4,6,8] to get the PowerBuilder syntax int n[4,6,8] or set array size to [,,] to get the c# syntax int[,,] n;

Depending on the model language, the following will be generated:
  • Java, C# and C++ – [2][4][6]

  • PowerBuilder – [2,4,6]

  • VB .NET – (2,4,6)

Enum class

[Java 5.0 and higher] Specifies an anonymous class for an EnumConstant. Use the tools to the right of the field to create, browse for, or view the properties of the currently selected class.

Static

The attribute is associated with the class, as a consequence, static attributes are shared by all instances of the class and have always the same value among instances.

Derived

Indicates that the attribute can be computed from another attribute. The derivation formula can be defined in the attribute description tab, it does not influence code generation.

Mandatory

Boolean calculated attribute selected if the minimum multiplicity is greater than 0.

Volatile

Indicates that the attribute is not a member of the class. It is only defined by getter and setter operations, in C# it replaces the former extended attribute volatile. For more information on adding operations to a class, see Adding Getter and Setter Operations to a Classifier.

Detail Tab

The Detail tab contains the following properties:

Property

Description

Initial value

Specifies the intial value assigned to the attribute on creation.

Changeability

Specifies if the value of the attribute can be modified once the object has been initialized. You can choose between:
  • Changeable – The value can be changed

  • Read-only – Prevents the creation of a setter operation (a setter is created in the method inside the class)

  • Frozen – Constant

  • Add-only – Allows you to add a new value only

Domain

Specifies a domain (see Domains (OOM)), which will define the data type and related data characteristics for the attribute and may also indicate check parameters, and business rules.

Select a domain from the list, or click the Ellipsis button to the right to create a new domain in the List of Domains.

Primary Identifier

[class attributes] Specifies that the attribute is part of a primary identifier. Primary identifiers are converted to primary keys after generation of an OOM to a PDM. Exists only in classes

Migrated from

Contains the association name that is at the origin of creation of the attribute. Click the Properties tool to the right of the field to open the association property sheet.

For more information on migrating attributes, see Migrating Association Roles in a Class Diagram.

Persistent

[class attributes] Specifies that the attribute will be persisted and stored in a database (see Managing Object Persistence During OOM to PDM Generation).

Code

Specifies the code of the table or entity that will be generated in a persistent CDM or PDM model.

Data type

Specifies a persistent data type used in the generation of a persistent model, either CDM or PDM. The persistent data type is defined from default PowerDesigner conceptual data types.

Length

Specifies the maximum number of characters of the persistent data type.

Precision

Specifies the number of places after the decimal point, for persistent data type values that can take a decimal point

Overrides

[PowerBuilder only] Indicates which parent attribute the current attribute is overriding through a generalization link