Chapter 3 Building Structural Diagrams


Attribute property sheet General tab

The General tab contains the following properties:

Property Description
Parent 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 [For Java 5.0 only] Specifies an anonymous class for an EnumConstant. To create the class, click the Create tool to the right of this property. To open the property sheet of this anonymous class, click the Properties tool .To delete it, click the Delete tool.
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 section Adding Getter and Setter operations to a classifier.

 


Copyright (C) 2006. Sybase Inc. All rights reserved.