Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > Ada Code > Generating Ada code > Mapping information for generation > Mapping information for Ada 83 generation scheme > Association and aggregation mapping for generating Ada 83 (Ada code)
  
Association and aggregation mapping for generating Ada 83 (Ada code)
This topic applies to both Associations and non-composite Aggregations.
For each valid Association, ACS generates a variable or a field within an Ada package, record type or variant record type. An Association is valid only if the following criteria are true:
The Association Type is Start-end, End-start or Bi-directional. If the Association Type is None, the Association is ignored.
The Class or Data Type at the source end of the Association (both Classes or Data Types for a Bi-directional Association) is generated as an Ada package, record type or variant record type.
The Class or Data Type at the destination end of the Association is generated as a record type, variant record type, task or task type.
The Association (Role) Multiplicity is not TBD. If the Association has TBD Multiplicity, the Association is ignored and an error is added to ACS log. User-defined multiplicities generate an array of access types.
The generation of a variable or field is derived from the properties of the Association and Role, and the Stereotypes and Tag Definitions that are applied to the Role:
Unnamed Roles are generated with an 'r' prefix, and named Roles are generated without an 'r' prefix. Prefixing and suffixing of named and unnamed Roles is controlled through the [role] and [unnamed role] sections of the Ada_mangle.ini file. For example, if you want all Roles to be generated with an 'r' prefix, ensure that the Role sections of the Ada_mangle.ini file are as follows:
[role]
AddPrefix=r
AddSuffix=
[unnamed role]
AddPrefix=r
AddSuffix=
If the Role is not a composite aggregate, the type of the variable or field is an access type to the record type of the package that represents the associated Class or Data Type.
If the Role is a composite Aggregate, the type of the variable or field is the record type of the package that represents the associated Class or Data Type.
The Name of the role is used to generate the name of the variable, prefixed an 'r'. If the Role is unnamed, the name of the target class prefixed with an 'r' is used.
If the Role owned by the Class or Data Type at the source end of the valid Association has On Instance storage, ACS generates a field in the package specification.
If the Role owned by the Class or Data Type at the source end of the valid Association has On Class storage, ACS generates a variable. The Visibility property of the Role determines where the variable is declared:
If the Role's Visibility property set to Public or Package, ACS generates a variable within the package specification.
If the Role's Visibility property set to Private, ACS generates a variable within the package body.
If the Role's Visibility property set to Protected, ACS generates a variable within the private area of the package specification.
If the Role is stereotyped by the «Ada Representation» stereotype, the generated variable declaration includes a representation clause. The tagged value of the Ada Representation Text tag definition is used to generate the representation clauses.
If the Role is stereotyped by the «Ada Pragma» stereotype, the tagged value of the Ada Pragma Text tag definition (applied by the «Ada Pragma» stereotype) is used to generate the pragmas.
If the Role is stereotyped by the «Ada Typed Role»stereotype and the tagged value of the Ada Role Data Type tag definition (applied by the «Ada Typed Role» stereotype) references a Type Definition, the referenced Type Definition is generated as the data type.
If the Role is stereotyped by the «Ada Variant» stereotype, ACS generates the component of the record type as a variant. The value of the Ada Case tag definition (applied by the «Ada Variant» stereotype) is generated as the variant text.
* 
The package specification created for the Class or Data Type at the source end of the Association includes a dependency to the package specification created for the Class or Data Type at the destination end of Association.