Chapter 3 Building Structural Diagrams
Migrating association roles in a class diagram
You can migrate association roles and create attributes before generation. This is very convenient for many reasons including data type customization and the ability to change the attribute order in the list of attributes. The last feature is especially important in XML.
Regardless of the navigability, the migration creates an attribute and sets its properties as follows:
- Name and code of the attribute: association role if already set, if not the association name
- Data type: code of the classifier linked by the association
- Multiplicity: role multiplicity
- Visibility: role visibility
Migration rules
The following rules apply when migrating association roles:
- If the migrated attribute name is the same as the role name, then modifying the role name synchronizes the migrated attribute name
- If the migrated attribute data type is the same as the role classifier, then modifying the role multiplicity synchronizes the migrated attribute multiplicity
- If the code of the classifier, linked by the association, changes, then the migrated attribute data type is automatically synchronized
- If you manually change the migrated attribute, the synchronization does not work, the association role is not synchronized
- The migrated attribute is automatically deleted if the association is deleted
After migration, the property sheet of the new attribute displays the name of the association in the Migrated from box in the Detail tab.
Migrating navigable roles
You can migrate the navigable role of an association and turn it into an attribute:
To migrate navigable roles:
- Right-click the association in the diagram.
- Select Migrate→Migrate Navigable Roles from the association contextual menu.
An attribute is created and named after the navigable role of the association followed by the code of the classifier.
Copyright (C) 2006. Sybase Inc. All rights reserved.
|
|