2017-01-10 晩 模版模式

策略模式:我定义一个算法家族,并让这些算法可以互换。正因为每一个算法家族都被封装起来,所以客户可以轻易地使用不同的方法。


模版模式:定义一个算法的大纲,由子类决定其中某些步骤的内容。这样算法中的个别步骤可以有不同的实现细节,但是算法的结构依然维持不变。


|ˈstrætədʒi|

1. Strategy uses ____ rather than inheritance.

composition |ˌkɒmpəˈzɪʃn|


4. Type of sort used in Arrays.

merge sort |mɜːdʒ| v 合并、


6. The Template Method Pattern uses ____ to defer implementation to other classes.

inheritance |ɪnˈherɪtəns| n 承、遗传

defer |dɪˈfɜː(r)| v 推


8. Coffee and ____

tea


9. Don’t call us, we’ll call you is known as the ____ Principle.

hollywood


12. A template method defines the steps of an ____.

algorithm |ˈælgərɪðəm|


|ˈtʃæptə(r)|

13. In this chapter we gave you more ____.

caffeine |ˈkæfiːn|


14. The template method is usually defined in an ____ class.

abstract


2. ____ algorithm steps are implemented by hook methods.

optional |ˈɒpʃənl| adj 可选择


3. Factory Method is a ____ of Template Method.

specialization |ˌspeʃəlaɪˈzeɪʃn, American -lɪˈz-| n 门化、专业领


7. The steps in the algorithm that must be supplied by the subclasses  are usually declared ____.

abstract

|dɪˈkleə(r)| vt 宣告


9. A method in the abstract superclass that does nothing or provides default behavior is called a ____ method.

hook


10. Big headed pattern.

strategy

Big headed 自负 傲慢的


15. The Arrays class implements its template method as a ____ method.

static


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值