What are the three classifications of patterns, according to the Gang of Four? What is the fourth classification that the authors suggest?
结构型、行为型、创建型。
第四种:解耦型模式。
3:
What is the one true thing about requirements?
需求总是在变化,无法准确把握。
4:
What is the intent of the Observer pattern?
使得当一个对象的状态改变时,所有依赖者都能够得到通知并自动更新。
Interpretation
1:
Why are the Bridge and Decorator patterns more correctly classified as structural rather than behavioral patterns?
行为型模式是为了对象间完成某种行为,并使得他们不相互耦合,而产生的模式,重心是对象的行为。
结构型模式是为了组合各个功能,或者组合各个对象而产生的模式,重心是对象间的层次关系。
桥模式是为了将抽象的实现和实现解耦,并且是将实现的各个功能组合而成。
装饰者模式为了在原有的功能点上,增加其他功能,而出现的。
2:
One example of the Observer pattern from outside of software is a radio station: It broadcasts its signal; anyone who is interested can tune in and listen when they want to. What is another example from "real life"?
杂志订阅,客户向杂志社订阅杂志,一旦杂志到货,杂志社会把杂志发送给每个用户。
3:
Under what conditions should an Observer pattern not be used?
当某个对象改变,需要通知其他对象,而其他对象又是不确定时,使用观察者模式。
Opinion and Application
1:
The "fourth category" of patterns somewhat includes patterns from other categories. Is this a good idea? Why or why not?