




已阅读5页,还剩7页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Suggested answer for Exercise 5.1The restaurant object is clearly not a boundary object, but it might appear to share some characteristics of both control and entity objects. As it is responsible for maintaining data, it might be argued that the entity stereotype was appropriate. This stereotype is normally used for data in the system that represents a single external entity, however. The restaurant object does not represent an entity in this sense, however, but instead makes other entities available in the system. The entity stereotype is probably not appropriate for the restaurant object, therefore. There is a control aspect to the restaurant object, as it is controlling access to the entity data held by the system. This is more a question of being a gatekeeper to some system resources than controlling a number of interactions, as the booking system object does, and it is probably clearer not to represent both by the same stereotype. It therefore appears that none of the analysis class stereotypes straightforwardly applies to the restaurant object, and it has been left in Figure 5.4 as a plain object. Suggested answer for Exercise 5.2The date attribute in the booking system class represents the date for which booking information is currently being displayed by the system. The date attribute in the current bookings should be the same as this, therefore, otherwise the system will be displaying bookings for the wrong date. This can be specified by a constraint on the current association as shown below. Suggested answer for Exercise 5.3On the face of it, this proposal might seem to be attractive on the grounds of removing redundancy, following the guideline that data should not be stored in more than one place. However, removing the date attribute from the booking system object would create problems in the situation where there are no bookings yet recorded for a date the system is asked to display. In this case, the system would have no record of what date was currently being displayed. If a walk-in booking was then created, for example, it would be difficult to work out the date required for the new booking object. This suggests that storing the date in both classes is not in fact redundant, as the two occurrences of the attribute have different semantics, one referring to the date being displayed by the system, and the other to the date of an individual booking. In cases like this, care needs to be taken before optimizing one of the attributes away. Suggested answer for Exercise 5.4Producing a realization for this scenario involves deciding which object is responsible for detecting that the date is invalid. A reasonable guideline to adopt here is to validate user-entered data as soon as possible. This would mean that the booking system object should be responsible for detecting errors, and so a realization might be as follows. The restaurant and booking objects have been left on this diagram to emphasize that they do not receive any messages in the course of this interaction. It is not necessary at this level of detail to attempt to specify how the system reports the error to the user and requests reentry of the date. We can simply assume that when the user reenters the date a new system message will be generated, and either the interaction above or the one in Figure 5.5 will take place again. Suggested answer for Exercise 5.5The complete sequence diagram is shown below. Suggested answer for Exercise 5.6The sequence diagram for Record walk-in is shown below. Apart from changing the actor, class and operation names throughout to refer to walk-ins, the most significant change is that a customer object does not need to be located. Details referring to customers have therefore been removed from the diagram. Suggested answer for Exercise 5.7A realization for the case where the customer is already known to the system is shown in the diagram below. As in Figure 5.5, the restaurant object retrieves data from customer objects to compare with the name and phone number of the requested customer. Assuming that a match is found, a customer object is returned to the caller. In the case where no matching customer is found, a new instance is created and a reference to it is returned to the caller, as shown below. Suggested answer for Exercise 5.8A possible sequence diagram for table transfer is shown below. The required table is first selected, as shown in Figures 5.9 and 5.11. Then the table object corresponding to the number of the new table is retrieved from the restaurant object, as in Figure 5.8. Finally, the table allocated to the selected booking is updated, and the display refreshed. An alternative design might pass the table number to the selected booking, which would then have to retrieve the required table object from the restaurant itself. This design is slightly more decentralized than the one above, but on the other hand introduces a circular dependency between the booking and restaurant classes. The design shown above is therefore probably preferable. Suggested answer for Exercise 5.9The diagrams below show the classes from Figure 5.13 with type information added to attributes and operations. The additions are strictly based on what is stated in the various realizations given in Chapter 5, and do not attempt to define final signatures for the operations. This will be considered later when implementing each
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 防汛日常应急知识培训课件
- 9.18事变防空演练方案3篇2025
- 建筑防水工程公司合伙协议书
- 达标工程工作实施方案(3篇)
- 艺术品买卖合同注意事项
- 影视产业全球市场走势与预测
- 借款合同个人公司3篇
- 风湿安泰片不良反应风险评估模型构建-洞察及研究
- 转让合同协议书样本5篇
- 老年骨质疏松椎体骨折术后护理查房
- 2024年人教版九年级英语单词默写单(微调版)
- 2024年东南亚解热镇痛类原料药市场深度研究及预测报告
- 2020年新人教版必修三《Unit 2 Morals and Virtues》单元教案(附导学案)
- 《民航客舱设备操作与管理》课件-项目四 飞机舱门及撤离滑梯
- DL-T 1476-2023 电力安全工器具预防性试验规程
- 2023年10月自考02207电气传动与可编程控制器PLC试题及答案含解析
- 网络自动化运维教程-课程标准
- 项目及其策划方案
- 《食品质量检验分析技术》
- 百家争鸣详解课件
- 肠内营养并发症预防与处理指南
评论
0/150
提交评论