《设计模式解析》 第14章 设计模式的原则与策略 复习题
来源:互联网 发布:改装荣威矩阵式led大灯 编辑:程序博客网 时间:2024/05/13 22:34
《设计模式解析》 第14章 设计模式的原则与策略 复习题
Review Questions
Observations
1:
When it comes to choosing how to implement a design, what question should you ask?
该设计的主要关注点是什么?该设计的背景是什么?该设计的主要变化的地方?
2:
What are five possible errors in using design patterns. Can you state them?
1、187页。
Interpretations
1:
The "open-closed" principle says, "modules, methods, and classes should be open for extension while closed for modification." What does this mean?
模块,方法和类都应该能够对修改封闭:修改软件可能会引入新的问题,故尽可能的不要修改软件。
对扩展开放:能够应对变化的需求,能够方便加入新功能。
因此,合二为一就是:能够在不修改软件的情况下,扩展其功能。
2:
In what way does the Bridge pattern illustrate the open-closed principle?
桥模式中,在抽象类以及派生类中,使用具体实现的抽象进行操作,使得实现变化或者增加的时候,Abstraction 部分无需修改,就可以适应变化。
Opinions and Applications
1:
Even though a design pattern might give you insights into what could happen, you do not have to build your code to handle those possibilities. How do you decide which possibilities to handle now and which to be ready for in the future?
根据项目当前的需求,以及项目当前所处的背景进行分析,进而决断。
2:
Give a concrete example of the danger of misapplying a design pattern, based upon your current work
- 《设计模式解析》 第14章 设计模式的原则与策略 复习题
- 《设计模式解析》第5章 设计模式简介 复习题
- 《设计模式解析》 第6章 Facade模式 复习题
- 《设计模式解析》 第7章 Adapter模式 复习题
- 《设计模式解析》 第9章 Strategy模式 复习题
- 《设计模式解析》 第10章 Bridge模式 复习题
- 《设计模式解析》 第11章 Abstract Factory 模式 复习题
- 《设计模式解析》 第17章 Decorate模式 复习题
- 《设计模式解析》 第18章 Observer 模式 复习题
- 《设计模式解析》 第19章 Observer 模式 复习题
- 《设计模式解析》 第23章 Factory Method 模式 复习题
- 《设计模式解析》 第8章 开拓视野 复习题
- 《设计模式解析》 第16章 分析矩阵 复习题
- 《设计模式解析》 第15章 共性与可变性分析 复习题
- 《设计模式解析》 第12章 专家设计之道 复习题
- 《设计模式解析》 第13章 用模式解决CADCAM问题 复习题
- 设计模式的原则和策略
- 设计模式的原则和策略
- GridView翻页时保持CheckBox选择状态
- android环境搭建之旅-- (三)XP下用source insight查看代码和SSH,putty的安装
- Android 4.0中Launcher编译
- Chrome浏览器在用户访问一个不存在的网址时,会重新发起一个请求?
- java面向对象思想笔记
- 《设计模式解析》 第14章 设计模式的原则与策略 复习题
- 如何用UltraISO制作ISO文件?
- while(scanf("%d",&n)!=EOF) ——那件小事
- 趣味二分法
- mysql restore from sql damp
- CATCH缓存
- CHK文件恢复
- scanf, sscanf 函数用法
- Android学习三、SurfaceView的学习