首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
In looking at the class structure of an entire system, we may find that its inheritance (1) is either wide and shallow, narrow a
In looking at the class structure of an entire system, we may find that its inheritance (1) is either wide and shallow, narrow a
admin
2009-09-04
26
问题
In looking at the class structure of an entire system, we may find that its inheritance (1) is either wide and shallow, narrow and deep, or balanced. Class structures that are wide and shallow usually represent forests of (2) classes that can be mixed and matched. Class structures that are narrow and deep represent trees of classes that are related by a common ancestor. There are advantages and disadvantages to each approach. Forests of classes are more loosely (3) , but they may not exploit all the commonality that exists. Trees of classes exploit this commonality, so that individual classes are smaller than in forests. However, to understand a particular class, it is usually necessary to understand the meaning of all the classes it inherits from or uses. The proper shape of a class structure is highly problem-dependent. We must make similar trade-offs among inheritance, aggregation, and using relation- ships. For example, should the class Car inherit, contain, or use the classes named Engine and Wheel? In this case, we suggest that an (4) relationship is more appropriate than inheritance relationship. Meyer states that between the class A and B," (5) is appropriate if every instance of B may also be viewed as an instance of A. The client relationship is appropriate when every instance of B simply possesses one or more attributes of A". From another perspective, if the behavior of an object is more than the sum of its individual parts, then creating an aggregation relationship rather than an inheritance relationship between the appropriate classes is probably superior.
选项
A、aggregation
B、using
C、composition
D、association
答案
A
解析
转载请注明原文地址:https://kaotiyun.com/show/YrxZ777K
本试题收录于:
软件设计师上午基础知识考试题库软考中级分类
0
软件设计师上午基础知识考试
软考中级
相关试题推荐
单个磁头在向盘片的磁性涂层上写入数据时,是以(6)方式写入的。
项目管理工具中,将网络方法用于工作计划安排的评审和检查的是(7)。
在面向数据流的设计方法中,把数据流图中的数据流划分为(8)两种。
简述什么是ISDN?依据ISO/OSI参考模型对无线扩频网络设备进行分类,可以分为哪几种类型?用无线扩频设备实现网络互连需要何种配套设备?
该企业网络的核心层采用了ATM技术,由三台ATM交换机互联构成。试对ATM网络技术的主要特点、协议分层结构和优点作简要叙述。PC1~PC4按100Mbps的以太网协议运行,PC1和PC2划分在一个虚拟网之中(VLAN1),PC3和PC4划分在另一个虚拟
(71)Inthestrengthofthecarriersignalisvariedtorepresentbinary1or0.(72)isasystemthatcanmapanametoan
(71)Inthestrengthofthecarriersignalisvariedtorepresentbinary1or0.(72)isasystemthatcanmapanametoan
关于自治系统(Autonomous System,AS),以下说法错误的是(26)。
BorderGatewayProtocol(BGP)isinter-autonomoussystem(71)protoc01.BGPisbasedonaroutingmethodcalledpathvectorrouting
某一非确定性有限自动机(NFA)的状态转换图如下图所示,与该NFA等价的正规式是(28),与该NFA等价的DFA是(29)。
随机试题
唐代时,日本遣唐使将中国的许多文化因素植入日本,甚至中国的马球、足球、围棋都传到了日本。()
村民甲承包一块土地,期限为30年,10年后,甲与邻地承包户乙约定,为了乙通行便利,甲在其承包地边缘开一条小路,乙为此一次性支付补偿费5万元。若双方未约定地役权期限,则乙享有的地役权期限为()。
巴金在“文革”后出版的重要散文集是()
属于鉴别培养基的是
试述宪法作用于公民和国家的区别。
依法需要经过批准开工报告方可施工的建设工程,建设单位应当于()15日内,将保证安全施工的措施报送建设工程所在地的县级以上人民政府建设行政主管部门或者其他有关部门备案。
对于发行债券所发生的发行费用的会计处理,下列说法正确的有()。
心理健康的人能够有效地发挥个人的身心潜力以及作为社会一员的()。
A、Shedoessometeachingwork.B、Shedoesherhomework.C、Sheworksasababysitter.D、Sheattendsweekendlessonstoimprovehe
IcecreambecamepopularinFranceinthe1500s,butonlyamongroyalty.Overthenextfewcenturies,theprocessofmakingthem
最新回复
(
0
)