问题
问答题
[问题3]
根据说明中的叙述,抽象出如下表所示的方法,请指出上图中的类Customer- InformationSystem和
功能描述 | 方法名 |
向系统中添加客户 | addCustomer |
根据给定的客户标识,在系统中查找该客户 | getCustomer |
根据给定的客户标识,从系统中删除该客户 | removeCustomer |
创建新的联系人 | addContact |
在系统中查找指定的联系人 | getContact |
从系统中删除指定的联系人 | removeContact |
答案
参考答案:
解析:[问题3] CustomerlnformationSystem的方法: addCustomer,getCustomer,removeCustomer。 InstimtionalCustomer的方法: addContact,getContact,removeContaet。[问题3] 类CustomerlnformationSystem的作用是向用户提供与客户管理相关的操作接口。由于联系人是由集团客户创建和管理的,按照面向对象的理念,与联系人相关的直接操作应由类InstitutionalCustomer来提供。因此addCustomer,getCustomer,removeCustomer为CustomerlnformationSystem的方法,而addContact,getContact,removeContact为类 InstitutionalCustomer的方法。