Prev Next

Create Properties

You can configure Enterprise Architect to automatically create properties in the modeled code in any of the programming languages that the system supports. You control property creation from the Properties window for Attributes. Each language has slightly different syntax and generates slightly different results:

  • Java and C++ generate get and set functions
  • C# and VB.Net create property functions
  • Delphi creates get and set functions as well as a specialized Delphi property Tagged Value

Access

Ribbon

Design > Element > Editors > Properties

Context Menu

Right-click element in Browser window or diagram | Properties | Properties

Keyboard Shortcuts

Ctrl+2

Configure Properties for an attribute

Step

Action

See also

1

In the Browser window or a diagram, click on the attribute for which to configure property creation. The attribute becomes the focus of the Properties window.

2

Expand the 'Details' section of the 'Attribute' tab, and click on the 'Property' field and on the Browse. button.

The 'Create Property Implementation' dialog displays.

3

The 'Language' panel defaults to the radio button for the language defined in the Class properties; however, you can click on any other radio button to select another language for which to configure property creation.

Each language enables its own combination of fields in the 'Property Details' panel.

4

The 'Name' field defaults to the name of the attribute. If necessary, you can overtype this with a different name.

Select the checkboxes or values from drop-down lists for these fields as required (and if available) to define the property for the selected programming language:

  • By Ref
  • Stereotype
  • Get Scope
  • Set Scope
  • Published
  • Read
  • Write
  • Abstract

5

Click on the OK button

The system generates the required operations and properties to comply with the selected language.

Notes

  • Get and Set functions have the stereotypes «property get» and «property set», making it easy to recognize property functions in the operations compartment of the element on a diagram; you can also hide these specialized functions on a specific diagram, by deselecting the 'Property Methods' checkbox on the 'Features' page of the 'Properties' dialog for the diagram, which then makes it easier to view the Classes uncluttered by many get and set methods
  • For the Delphi programming language, enable the Tagged Values compartment to see the generated property Tagged Value

Learn more