Attribute mapping for IDL (IDL code)
For each Attribute, ACS generates an attribute declaration in the appropriate IDL file.
ACS generates code similar to this for Component and Interface owned Attributes:
// Attribute declarations
attribute boolean Attribute1 raises(Exception1) getraises(Exception2)
ACS generates code similar to this for Value Type owned Attributes:
// Attribute declarations
private boolean Attribute1;
ACS generates code similar to this for Class, Connection, Port Type and Message owned Attributes:
// Attribute declarations
boolean Attribute1;
When an Attribute is created for a Component, Connector, Interface, Message, Port Type or Value Type, the «IDLAttribute» stereotype is applied to the Attribute and setraises and getraises exceptions can be specified.
ACS uses Attributes for generating the content of a Deployment Plan's Component Deployment Plan (CDP) file.
Important: The Default property of a Component, Connector or Process Type owned Attribute is not set through its Default property, but is set through the Deployment Plan Editor. Tell me more...
Reverser Notes: When reverse engineering an attribute, the Reverser will reverse engineer the attribute as a Role if all of the following statements are true:
The IDL attribute's data type can be identified as a class, connector, message, structure or value type in the code being reverse engineered.
The IDL item that is used as a data type is being reverse engineered.
The Reverser cannot match the IDL attribute to an Attribute in the Model.
The generation of an Attribute in an IDL file is derived from its properties.
Constants
To model a constant, make the Attribute read-only, specify the default value and apply the «CORBAConstant» stereotype.
To model a module scoped constant. Create a Class named Constants that is scoped to the Package that represents the module, and apply the «CORBAConstants» stereotype to that Class. Create an Attribute as a child of the Constants class, make the Attribute read-only, specify the default value and apply the «CORBAConstant» stereotype.
ACS generates code similar to this for a constant:
const char CompanyName = PTC
Child items:
Not applicable.
Properties:
If the Data Type property is set, ACS generates the value as the attribute's data type.
If no data type is specified and no value is set for the Data Type tag definition, ACS generates UNDEFINED_TYPE.
Note that the Data Type property is set only when a Class is used as a type. When a Basic Type or Type Definition is used as a type, the tagged value of the Data Type tag definition is set.
Reverser Notes: When reverse engineering an attribute's data type:
If the data type is modeled in the Model or is going to be reverse engineered to the Model, the Attribute's Data Type references the appropriate item.
If the data type is not modeled in the Model and is not going to be reverse engineered to the Model, the Attribute's Data Type is set to the name of the data type (as text).
The Default property is ignored or generated depending on the owning item:
If the owning item is one of the following types and the Attribute is set up as read-only (the Read Only check box is checked), ACS generates the value of the Default property as the attribute default value: Connector, Message, Port Type, Packages, Class, Data Type Signal.
If the owning item is one of the following types, the Default property is ignored: Component, Structure, Value Type or Interface.
If the owning item is a Component, Connector or Process, the default value of an Attribute can be set through the Deployment Plan Editor. Tell me more...
If the Description property has a value, ACS generates the Description as a comment on the line before the attribute declaration.
If the Multiplicity property is set to 'only one', ACS generates the attribute declaration as having a single value. If the Multiplicity property is set to a value that isn't 'only one', ACS generates the attribute declaration as a sequence.
ACS generates the Name property as the name of the attribute in the code.
Note ACS may modify the attribute name that is added to the code to make it valid for IDL. You can specify the exact attribute name to add to the code through the CODE_GENERATION_NAME property of an Attribute. Tell me more...
If the Read Only property is set to TRUE (Read Only check box selected on Property Pages), ACS generates the attribute declaration as readonly or const as appropriate, unless the Attribute is owned by a Structure in which case the Read Only property is ignored. If the Attribute has a setraises value and the Attribute is Read Only, ACS generates raises exceptions rather than setraises exceptions.
ACS generates the Visibility property for Value Type owned Attribute as is before the Attribute's type.
Other properties of Attributes are ignored.
Tag Definitions:
If the tagged value of the getraises tag definition is set for a Component or Interface owned Attribute, ACS generates the referenced Exceptions as the attribute's getraises exceptions.
If the tagged value of the setraises tag definition is set for a Component or Interface owned Attribute, ACS generates the referenced Exceptions as the attribute's setraises exceptions. If the Attribute is Read Only, ACS generates raises exceptions rather than setraises exceptions.
If you have applied the «CORBAConstant» stereotype to a Class, Connector, Interface, Message or Port Type owned Attribute, ACS generates the attribute as a const.
If you have applied the «key» stereotype to a Class scoped Attribute, a key comment is appended to the declaration of the member of a struct.