Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Attributes
To represent the properties or internal data elements of an element, you create features of the element called attributes. Not all element types support attributes, and others have restrictions; for example, attributes of Interfaces must have Public scope. In the Project Browser, elements with attributes (typically Classes) have their attributes listed under the element name, each preceded by a blue box (). When depicted in diagrams, the attributes are listed in colored text in the first properties compartment of the element - the default color is red (for example, Age : int). In the following Customer Class example, the customer Name and Address are attributes.
Attributes have several important characteristics, such as type, scope (visibility), derivation and notes.
Access Right-click element in diagram/Project Browser | Attributes (F9)
Maintain Attributes
Action |
Detail |
See also |
---|---|---|
Create and Modify Attributes |
On the <Element name> Attributes dialog, you create and modify attributes on the four dialog pages. |
General Properties of Attributes Attributes Dialog - Constraints
|
Move and Copy Attributes |
You can copy or move existing attributes between elements, if the target element also supports attributes. |
Copy Features Between Elements Move Features Between Elements
|
Define Properties |
You can create property implementations specific to your coding languages for each attribute.
|
|
Identify Inherited Attributes |
The attributes of an element can be inherited from one or more successive parent elements in the model. On a diagram, you can show which attributes are inherited from which 'owning' element in the hierarchy.
|
Notes
• | If you make changes and do not save them, the Cancel button prompts you to save or cancel the changes, whilst the Close button closes the dialog immediately and does not save the changes |
• | If you are creating many attributes, go to the Attribute/Operations page of the Options dialog (Tools | Options | Source Code Engineering | Attribute/Operations) and de-select the After save, re-select edited item checkbox; now, when you create an attribute and click on the Save button, the dialog fields clear ready for you to enter the details of the next attribute - this helps you when you want to create attributes quickly and might not necessarily want to fully define each one as you create it |
• | If the parent element provides source or target roles for a connector, the connector can be attached to a specific attribute (feature) |
• | An alternative method of creating relationships between elements and attributes is to drag an attribute onto an Activity diagram, which generates an Object element named after the attribute; you then create relationships to and from this Object element |
Learn more