You can easily convert a file to an object or vice versa
by simply highlighting the object in the browser, then selecting Change
to and the intended result.
Procedure
To convert a file to a class:
- Highlight the file in the browser, right-click
and then select . The file changes to an object and moves to the Objects category
in the browser.
- Highlight the object in the browser, right-click
and then select Expose Class. This creates
a class with the name <object> class.
It contains all the content of the copied object including the attributes,
operations, and statechart. This option is only available for an implicit
object.
Results
Note the following information:
- If you are trying to convert an object to a file
and there are aggregates that are not allowed for files, IBM® Rational® Rhapsody® issues
a warning message.
- Objects that are owned by another class or object
cannot be converted to files.
When the element has been converted, the graphical
representations change in the diagrams and the converted element is
moved to the appropriate category in the browser.
For
information about changing the order of files, see Editing the declaration order of objects.