Objects have a name, a type, possibly some children and one or more parents. However, this is often not enough. Thus, in
Below, you can seen an Enumeration attribute called Component Type.
As is the case with types, attribute names are unique: two different attributes must thus have different names. You should note that:
- While attached to a type, attributes are not defined within the type, they remain defined at the project level.
- The same attribute can be used by several types.
- Attributes are not transitive, a type does not inherit attributes from either its parents or children.
Attribute Types and Values
Attributes are given an attribute type (text, number, date, etc), for more information see Available Attribute Types. Each object instance can be assigned an attribute value corresponding to the type of the attribute.
A type attribute can have a default value. If two object types use the same attribute, they will have the same default value. However, default values will only be applied to newly created objects.
If an attribute has a default value, it can be configured to force all the future instances of the attribute to keep the default value, forbidding the use of overriding individual values (for more information see Type Attribute Properties).
There are some special cases concerning default values:
- Object as Attribute, where the attribute has a specific object type as its value, cannot have a default value.
- The default value of an Enumeration attribute is one of its enumerators, so you must define at least one enumerator before setting the default value of an Enumeration attribute.
- The default value of a Date attribute can be set to the creation date of the instances.
Visibility in Diagrams
Attribute values are by default shown in the Internal Block Diagram but their name or icon (or both) or even everything concerning the attribute (including its value) can be hidden. See Type Attribute Properties for more information.
The following pages will show you how to work with type attributes: