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 Attributes page of the Features dialog. 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    On diagram | Right-click element | Features & Properties | Attributes (F9)  or
Project Browser | Right-click element | Attributes

Configure Properties for an attribute



See also


In the list of attributes, click on the attribute for which to configure property creation.




In the lower left panel of the dialog page, click on the Property field and on its Browse ( ... ) button.

The Create Property Implementation dialog displays.




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.




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
·Get Scope
·Set Scope




Click on the OK button

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




·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 tab/page of the Diagram Properties dialog, 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