Assocs2Attribs

Home Up

 

 

Associations to Attributes

There are different versions of this script available, please select one:


Java Associations to Attributes by Holger Dörnemann

This script is intended to use with Rose98/Java Reverse Engineering. On reverse engineering attributes of type String or Vector, etc. ("extended" basic types) are substituted by association roles. Solution: This script deletes associations to String etc. and creates attributes of the specific type instead.

This script will ONLY work when you reverse engineer Java. The reason is that the script is optimized for the Java Add-In. It only looks at the 'Role2' property, this is always the 'type' in the Java source. The script only supports "String" and "Vector", you will have to add all the names of the other classes to the script.

Download (6KB) (July 1998)

www.rationalrose.com/scripts/assocs2attribs_java.ebs


C++ Associations to Attributes v1.2 by David Hanslip

This script reads classes from a text file nominated by the user. For each class read from the file, call it theAttributeClass, the script converts any associations from classes in the current model to theAttributeClass, navigable to theAttributeClass, into attributes. 
 
The Name of the attribute will be the role of theAttributeClass in the original relationship. Since this script is intended to be applied to reverse engineered models it is assumed that there will always be a role name in place. Where multiplicity is 1, the type of the attribute will be theAttributeClass. Where the multiplicity is "*", the attribute type will be the theAttributeClass concatenated with the value of the ContainerClass property (minus its preceding $targetClass). Where the multiplicity is "0..1", the attribute type will be theAttributeClass 
concatenated with "*". In this case, the contents of the role initial value property (which may be (NULL)) is copied to the attribute InitValue property. Class names are case sensitive. 

Association Documentation is copied to the Attribute Documentation. The following code generation properties are copied across:

  • DataMemberVisiblity
  • GenerateSetOperation
  • GetSetKinds
  • GetIsConst
  • GetSetByReference 

GenerateGetOperation is not copied across because the default is TRUE. If there is no 
Get operation present in the code, the analyzer leaves the property unchanged.

Download (8KB) (June 1998)

www.rationalrose.com/scripts/assocs2attribs_cpp.ebs


Has Relationships to Attributes by Zbigniew Babiej

This script parses the Logical View for the categories and their classes and changes Has Relationships into attributes.

Download (4KB) (April 2000)

www.rationalrose.com/scripts/convert_has_to_attrib.ebs



All products mentioned are registered trademarks or trademarks of their respective companies.
Send mail to webmaster@rationalrose.com with questions or comments about this web site. 
Copyright © 1999-2000 Michael Moors
Last modified: May 02, 2000