问题 单项选择题

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.

(2)

A.free-standing

B.alone

C.only

D.lonely

答案

参考答案:A

多项选择题 案例分析题

一般资料:求助者,女,25岁,未婚,中学教师,经济状况良好。求助者主诉:最近半年以来我情绪很低落,经常觉得自己很委屈,有时候偷偷地哭,觉得社会的现实太残酷了,对大部分事情都无精打采的,对工作和生活都提不起兴趣,对未来的生活感到悲观失望,认为自己的人生已经走到尽头了,生活在悔恨和痛苦中。现在每天不想吃饭,失眠,工作的时候无法集中注意力,记忆力大不如以前,脾气急躁,一点小事就会发脾气。自己最近一直在调节自己的情绪,但是还是摆脱不了,只好前来咨询,希望咨询师可以帮助自己。心理咨询师了解的情况:求助者身体一直健康,没有疾病史。在大人的眼中求助者是一个好孩子,性格内向,做什么事情都让父母放心。求助者的父母对她要求严格,但是很关心她。22岁的时候谈过一个男朋友,半年以前男友与别的女孩子亲热,她感觉一切就此完了,很生气,悔恨交加,与男友大吵。男友向求助者道歉,但求助者还是怀恨男友。曾想过分手,但是考虑的因素太多:分手了以后该怎么办,自己已经不是处女了,还有人要自己吗?大家一定会笑话自己。不分手的话自己心里一直有阴影。求助者在这种心理矛盾之下,渐渐地憔悴了,情绪也很低落,脾气越来越暴躁。听到有人谈论男女朋友的事情,就很敏感、脆弱。虽然还能坚持工作,但积极主动性较以前降低很多,生活兴趣也不如以前了。

本案例中求助者的生理症状包括()。

A.失眠

B.厌食

C.心慌

D.头痛

单项选择题