问题 单项选择题

如图1所示的UML类图描绘的是设计模式中的(1)模式。如图2所示的UML类图描述了该模式的一种应用,其中与图4中的“Abstraction”对应的类是(2)

(1)是()

A.Composite(组合)

B.Proxy(代理)

C.Bridge(桥接)

D.Command(命令)

答案

参考答案:C

解析:

如图所示的UML类图描绘的是设计模式中的Bridge(桥接)模式,它将抽象部分与现实部分分离,使得它们两部分可以独立地变化。其中,类Abstraction是一个抽象类,用于定义抽象类的接口,维护一个AbstractionImpl(实现抽象类)的对象。在图所描述的应用中,与类Abstraction相对应的是类DataAccess。

Command(命令)模式的设计意图是,将一个请求封装为一个对象,从而使用户可用不同的请求对客户进行参数化,对请求排队或记录请求日志,以及支持可撤销的操作。

Composite(组合)模式的设计意图是,将对象组合成树型结构以表示“部分一整体”的层次结构。

Proxy(代理)模式的设计意图是,为其他对象提供一种代理以控制对这个对象的访问。

完形填空
It was always thought that Treasure Island(金银岛) was the product(产物) of Robert Stevenson’s imagination(想像).  36 ,recent research has found the true story of this exciting work .
Stevenson, a Scotsman, had lived 37 for many years .In 1881 he returned to Scotland to spend  38 .With him were his American wife Fanny and his son 39 .
Each morning they would go out for a  40 over the hills .They had been 41 this for several days before the weather suddenly took a turn for the worse. Kept indoors by the heavy rain, Lloyd, Stevenson’s son, felt the days 42 .To keep the boy happy, Robert asked the boy to do some  43 .
One morning, the boy came to Robert with a beautiful map of an island. Robert 44 that the boy had drawn a large cross in the middle of 45 . “What’s that?” he asked “That’s the 46 treasure”, said the boy. Robert suddenly 47 something of an adventure(冒险) story in the boy’s 48 .While the rain was pouring ,Robert sat down by the fire to write a story. He would make the 49 a twelve-year-old boy just like Lloyd .But who would be molded(塑造) into the hero — a pirate(海盗)?
Robert had a good friend named Henley, who walked with the 50 of a wooden leg , Robert had always wanted to 51 such a man in a story.  52 Long John Silver, the pirate with a wooden leg, was 53 .
So thanks to a 54 September in Scotland, a friend with a wooden leg and the imagination of a twelve-year-old boy, we have one of the greatest  55 stories in the English language.
小题1:
A.However B.ThereforeC.BesidesD.Finally
小题2:
A.aloneB.next doorC.at homeD.abroad
小题3:
A.meeting B.storyC.holidayD.job
小题4:
A.LloydB.RobertC.HenleyD.John
小题5:
A.talkB.rest C.walk D.game
小题6:
A.attemptingB.missingC.planning D.enjoying
小题7:
A.warmB.dull C.busy D.cold
小题8:
A.cleaningB.writingC.drawingD.exercising
小题9:
A.doubted B.noticedC.decidedD.recognized
小题10:
A.the sea B.the houseC.Scotland D.the island
小题11:
A.lostB.buriedC.discoveredD.invented
小题12:
A.saw B.drew C.made D.looked
小题13:
A.bookB.replyC.mapD.letter
小题14:
A.singerB.hero C.writerD.child
小题15:
A.helpB.problemC.useD.up
小题16:
A.praiseB.produceC.mold D.accept
小题17:
A.Yet B.Also C.ButD.So
小题18:
A.readB.born C.hiredD.written
小题19:
A.rainyB.sunnyC.cool D.windy
小题20:
A.newsB.love C.travelD.adventure
多项选择题