Rose/Java mapping: introduction, definition of terms, страница 2

public |`protected | private = export selection (implementation type is used for package visibility) of the attribute/role.

static = static selection of the attribute/role

final = Attribute.Final or Role.Final property.

transient = Attribute.Transient or Role.Transient property.

volatile = Attribute.Volatile or Role.Volatile property.

type = can be either a fundamental type or a user-defined type:

If it is a fundamental type then the field is represented by an attribute and type is the type of the attribute.

If it is a user-defined type then the field is represented by a relationship whose supplier class is the user-defined type.

declarator = name of the attribute/role, which can define the field as an array by prepending square brackets (declarator[]).

Initvalue = optional initial value of the field maps to the attribute's initial value field or the Role.InitialValue property.

3.8.1  Special Cases

These special cases are provided as convenient ways to generate the appropriate constructs.  They are applicable for one-time forward engineering only.  If the resultant Java code is subsequently reverse engineered the resultant Rose model will differ from the original.  The differences are described below.

Array of User-defined Types

If a field-generating relationship has multiple (>1) cardinality, the Role.ContainerClass property is blank and the role name is not already defined as an array,  then it will be generated as a singly-dimensioned array.

When the resultant Java code is reverse engineered the appropriate role name will be defined as an array.

Container of User-defined Types

If a field-generating relationship has multiple (>1) cardinality and the Role.ContainerClass property is not blank, the property is used as the type of the field.  For example if the property were set to 'Vector' the field would be generated as

Vector declarator;

When the resultant Java code is reverse engineered a relationship is generated to a class whose name is that of the Role.ContainerClass property.

PROPERTIES

Attribute Properties

·  Final (Boolean FALSE) – Indicates whether the field is final

·  Transient (Boolean FALSE) – Indicates whether the field is transient

·  Volatile (Boolean FALSE) – Indicates whether the field is volatile

Role Properties

·  Final (Boolean FALSE) – Indicates whether the field is final

·  Transient (Boolean FALSE) – Indicates whether the field is transient

·  Volatile (Boolean FALSE) – Indicates whether the field is volatile

·  InitialValue (String "") – Defines the initial value of the field

·  ContainerClass (String "") – Defines the class to be used as a container for implementing relationships of cardinality greater than 1.

3.9  Bean properties

Any field can be declared to be a bean property via the attribute/role properties.  There are three properties involved, which must be used in a coordinated manner to produce the proper code.

3.9.1  Defining the Property

The PropertyType property is indicate whether a field is a property and, if so, what type of property.  It has four possible values:

·  Not A Property (default)

·  Simple

·  Bound

·  Constrained

For a simple property get/set methods are generated as appropriate.  For bound and constrained properties property change management members and methods are also generated.

3.9.2  Defining the Get/Set Methods

The Read/Write property controls which get/set methods are generated.  It has three possible values:

·  Read & Write

·  Read Only

·  Write Only

3.9.3  Defining Property Change Management

The default for property change management is to use a common management scheme for all the properties of the class.  For any field for which this is not appropriate individual change management can be defined by setting the IndividualChangeMgt property to TRUE.