Step 4: Extending the Model by Reverse-Engineering an Existing Class
|

Previous |

Next |
This final task shows you how to extend the model by adding an existing class
to the project and adding it to the diagram.
To extend the class model:
- Right-click the project node in the Navigator pane and choose New Java Class.
OR
Click the project node in the Navigator pane, choose New,
then choose Java Class from the General category of
the New Gallery.
- Enter the name of the class as
OrderItem
.
- Enter the package name as
orderEntry
.
- Deselect the Generate default constructor checkbox.
- Click OK.
The new OrderItem class is opened in the Code Editor.
- Click the Save icon on the toolbar, or choose File
| Save to save these changes to OrderItem.java.
- Click the diagram name in the Document Bar to display the diagram again.
- Drag the OrderItem class from the from the Navigator
pane, and drop on the diagram.
- Model a strongly aggregated association between Order
and OrderItem then examine the changes that appear
in the Java source code of OrderItem.java and
Order.java.
Finish the tutorial be reviewing the Modeling
Java Classes Tutorial Summary.
Related Topics:
Class Diagram Notation