2016-12-28 外观模式 + 适配器模式+迪米特法则+依赖倒转原则+里氏替换原则

2016-12-28 外观模式 + 适配器模式+迪米特法则+依赖倒转原则+里氏替换原则


1:class、2:stock(|stɒk| n 存活、股票)、3:public、4:void(|vɔɪd|)n 空白、无效的、空的、5:sell、6:console(|kənˈʊl| n 控制面板、控制台)、write、7:national(|ˈʃənl| adj 国家的、全国性的)、8:debt |det|、9:national debt[ˈʃənəl dɛt] n 国债、10:realty [ˈriəlti] n 不动产、11:static、12:main、13:argument [ˈɑ:rgjumənt] n 论据;争论,争吵; 主题,情节、14:fund |fʌnd| n 基金


子系统类集合 SubSystem Classes


True or false,Adapters can only wrap(|ræp| v 包,用…包 n外衣、披肩、围巾、毯子) one object : false.

An Adapter converts(convert v 转变 改装) an interface.

Adapter with two roles(role |rəʊl| n 角色、作用):two-way(adj 双向的).

Adapter(适配器) client uses the target interface.


Decorator(|ˈdekəreɪtə(r)| n 装饰者) called Adapter this : simple pass through.

A decorator(|ˈdekəreɪtə(r)| noun 室内装潢工) adds new behavior(|bɪˈheɪvjə(r)| n 行为).


One advantage(|ədˈˈvæntɪdʒ|n有利条件 好处) of Facade: decoupling(decoupling [dɪ'kʌplɪŋ] n. 退耦(装置) v. 减弱(核爆炸)).

Facade(|fəˈːd| noun正面 表面) still allows low level(|ˈlevl|) access.

A facade simplifies(simplify |ˈsɪmplɪfaɪ| v简化 精简) an interface.


Principle that wasn’t as easy as it sounded:least kNowledge.

disadvantage(disadvantage |ˌdɪsədˈvæntɪdʒ| noun不利条件) of the Principle of Least KNowledge:too many wrappers(wrapper |ˈræpə(r)| n 包装材料、书封套).

Least(|liːst|) KNowledge:talk only to your immediate friends.


No movie is complete(|kəmˈpliːt| adj 完整的、全部的) without this: popcorn.

Ducks do it better than Turkeys(turkey |ˈtɜːki| n 火鸡):fly.

New American dream(two words):home theater(|ˈθɪətə(r)| noun 剧场).

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...