题目详情

某客户信息管理系统中保存着两类客户的信息:

(1)个人客户。对于这类客户,系统保存了其客户标识(由系统生成)和基本信息(包括姓名、住宅电话和E-mail)

(2)集团客户。集团客户可以创建和管理自己的若干名联系人。对于这类客户,系统除了保存其客户标识(由系统生成)之外,也保存了其联系人的信息。联系人的信息包括姓名、住宅电话、E-mail、办公电话以及职位

该系统除了可以保存客户信息之外,还具有以下功能:

(1)向系统中添加客户(addCustomer)

(2)根据给定的客户标识,在系统中查找该客户(getCustomer)

(3)根据给定的客户标识,从系统中删除该客户(removeCustomer)

(4)创建新的联系人(addContact)

(5)在系统中查找指定的联系人(getContact)

(6)从系统中删除指定的联系人(removeContact)

该系统采用面向对象方法进行开发。在面向对象分析阶段,根据上述描述,得到如表2-5所示的类

表2-5 得到的各种类

中级软件设计师,模拟考试,2021年软件设计师模拟题7

类名说明

CustomerInformationSystem客户信息管理系统

IndividualCustomer个人客户

InstitutionalCustomer集团客户

Contact联系人

描述该客户信息管理系统的UML类图如图2-26所示

中级软件设计师,模拟考试,2021年软件设计师模拟题7

图2-26 客户信息管理系统的UML类图

【问题1】

请使用说明中的术语,给出图2-26中类Customer和类Person的属性

【问题2】

识别关联的多重度是面向对象建模过程中的一个重要步骤。根据说明中给出的描述,完成图中的(1)~(6)

【问题3】

根据说明中的叙述,抽象出如表2-6所示的方法,请指出图2-26中的类CustomerInformationSystem和InstitutionalCustomer应分别具有其中的哪些方法

表2-6 抽象出的方法

中级软件设计师,模拟考试,2021年软件设计师模拟题7

正确答案及解析

正确答案
解析

【问题1】

Customer的属性:客户标识

Person的属性:姓名、住宅电话、E-mail

【问题2】

(1)1(2)0..*(3)1

(4)1(5)1(6)1..*

【问题3】

CustomerInformationSystem的方法:addCustomer,getCustomer,removeCustomer

InstitutionalCustomer的方法:addContact,getContact,removeContact

【解析】

根据题目描述得知,客户信息管理系统的功能是管理个人用户和集团用户,个人用户和集团用户的区别在于集团用户有自己的联系人,而个人用户没有。

【问题1】

问题1要求考生给出类Customer和Person的属性。在图2-26中,Customer表示客户类,IndividualCustomer和InstitutionalCustomer都是Customer的子类,IndividualCustomer是个人客户,InstitutionalCustomer是集团客户。既然Customer是个人客户类和集团客户类的父类,则它必有两者的共同点。由于集团客户和个人客户都有客户标识,所以Customer的属性为"客户标识"。Contact是联系人,只有集团客户才有联系人。Person类是Contact类的父类,同时又与IndividualCustomer有关联,所以Person类应具有Contact与IndividualCustomer的共同点,它们的共同点就是联系人与个人客户都有自己的基本信息:姓名、住宅电话和E-mail。因此,Person的属性有:姓名、住宅电话和E-mail。

【问题2】

类CustomerInformationSystem表示的是客户信息管理系统,Customer表示的是客户类,一个客户信息管理系统中应有多个客户。所以CustomerInformationSystem与Customer之间的关系应是1:*。IndividualCustomer与Person其实是个人客户与该客户的基本信息之间的关系,显然一个客户只有一个基本信息,所以它们也是1:1的关系。最后是InstitutionalCustomer与Contact之间的关系,这也就是集团客户与联系人之间的关系,由于一个集团客户可有多个联系人,同时至少需要有一个联系人(如果联系人数量为0,则此客户为个人客户)。所以InstitutionalCustomer与Contact之间的关系应为1:1..*。

【问题3】

一个原则就可以解决这个问题:与客户操作相关的为CustomerInformationSystem的方法,而与联系人相关的操作是InstitutionalCustomer的方法。

包含此试题的试卷

你可能感兴趣的试题

单选题

Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.

  • A.Artificial Intelligence
  • B.Cloud Computing
  • C.Internet of Things
  • D.Big Data
查看答案
单选题

In project human resource management , ( )is not a source of power for the project manager.

  • A.referent power
  • B.expert power
  • C.reward power
  • D.audit power
查看答案
单选题

At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.

  • A.detail feasibility analysis
  • B.opportunity analysis
  • C.economic feasibility analysis
  • D.risk analysis
查看答案
单选题

( )is a grid that shows the project resources assigned to each work package.

  • A.Stakeholder engagement assessment matrix
  • B.Requirements traceability matrix
  • C.Probability and impact matrix
  • D.Responsibility assignment matrix
查看答案
单选题

Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.

  • A.digital
  • B.networking
  • C.intelligentize
  • D.informatization
查看答案

相关题库更多 +