Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
C# Automatic Property Support
For C# at and beyond release 4.0, Enterprise Architect enables you to model automatic properties as �Property� stereotyped attributes.
Topics:
Topic |
Detail |
See also |
|---|---|---|
Properties of Attributes |
When you create the attribute, on the General page of the Attributes dialog simply set the Stereotype field to Property; the generated code resembles the following:
public class Class1 { public Class2( ) Classes {get; set;} }
This is in contrast to the Enterprise Architect facilities for modeling get/set methods as properties of an attribute in various other languages, generating code such as:
public class Class1 { public Class3( ) m_delivery;
:
public Class3( ) delivery { get{ } set{ } } }
You cannot create properties with get/set methods on an automatic properties attribute; whilst the �Property� stereotype is assigned in the Attributes dialog, the Property checkbox is grayed out |
|
Tagged Values |
You can also add the following Tagged Values to automatic properties to denote specific characteristics, if required:
|
|
Reverse Engineering |
Imported automatic properties generate attributes with a �property� stereotype and appropriate Tagged Values, and - if the property type is a recognized element in the model - an Association connector |
|
Example:
