Suggested answer for Exercise 2.1
The class diagram is shown below. Note the following:
1. Fields in the Java classes that store references to other objects are shown in UML as associations between the classes, not as
attributes.
2. The cost function in the Component class is abstract: this is shown in UML by writing it in an italic font, as with the class
itself.
- 1
- 2
- 3
前往页