Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.
Set Collection Classes
Enterprise Architect enables you to define Collection Classes for generating code from Association connectors where the target role has a multiplicity setting greater than 1.
Topic |
Detail |
See also |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Defining Collection Classes |
On the Source Code Engineering section of the Options dialog (select the Tools | Options | Source Code Engineering option), on each language page click on the Collection Classes button.
|
|||||||||||||||||||
Defining Collection Classes for a specific Class |
Class-specific Collection classes can be defined by clicking the Collection Classes button in the Class Properties dialog of the element.
|
|||||||||||||||||||
Code Generation Precedence |
When Enterprise Architect generates code for a connector that has a multiplicity role >1:
|
|||||||||||||||||||
Using Markers |
You can include the marker #TYPE# in the collection name; Enterprise Architect replaces this with the name of the Class being collected at source generation time (for example, Vector<#TYPE#> would become Vector<foo>). Conversely, when reverse engineering, an Association connector is also created if a matching entry (e.g. foo if foo is found in the model) is defined as a Collection Class.
|
|||||||||||||||||||
Additional Collection Classes |
Additional Collection Classes can be defined in the language options page (C#, C++, Java). |
|||||||||||||||||||
Member Type |
On both the Source Role and Target Role tabs of the Association Property dialog (accessible from the right-click context menu of any Association) there is a Member Type field. If you set this, the value you enter overrides all the above options.
|
Learn more