Student_Answers_Chapter_02.doc

上传人:工**** 文档编号:549496807 上传时间:2023-12-24 格式:DOC 页数:3 大小:174.51KB
返回 下载 相关 举报
Student_Answers_Chapter_02.doc_第1页
第1页 / 共3页
Student_Answers_Chapter_02.doc_第2页
第2页 / 共3页
Student_Answers_Chapter_02.doc_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《Student_Answers_Chapter_02.doc》由会员分享,可在线阅读,更多相关《Student_Answers_Chapter_02.doc(3页珍藏版)》请在金锄头文库上搜索。

1、Suggested answer for Exercise 2.1The 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

2、in UML by writing it in an italic font, as with the class itself.Suggested answer for Exercise 2.2(a) The diagram below uses the names of the variables in the code as object names. Although this probably clarifies the current example, it runs the risk of confusing the two distinct concepts of object

3、 name and variable name. This is potentially dangerous in an environment where objects are reassigned to different variables. This diagram illustrates the different numbers of part objects that can exist for a catalogue entry: zero, one or many. (b) Apart from the assembly object, all the objects in this diagram have already appeared in the answer to part (a). (c) A client object has been added in this diagram, shown as sending the initial cost message to the assembly.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号