05 2019 档案
摘要:The Abstract Factory Design Pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their co
阅读全文
摘要:The Observer design pattern defines a one-to-many dependency between objects so that when one object changes states, all its dependents are notified a
阅读全文
摘要:The Prototype design pattern specifies the kind of objects to create using a prototypical instance, and create new objects by copying this prototype.
阅读全文
摘要:The Factory Method design pattern defines an interface for creating an object , but let subclasses decide which class to instantiate. This pattern let
阅读全文
摘要:代理模式(proxy):为其他对象提供一种代理以控制对这个对象的访问。在某些情况下,一个对象不适合或者不能直接引用另外一个对象,而代理对象可以在客户端和目标对象之间起到中介的作用。 The Proxy design pattern provides a surrogate or placeholde
阅读全文
摘要:1、单一职责原则(Single Responsibility Principle SRP):就一个类而言,应该仅有一个引起它变化的原因。 如果一个类承担的职责过多,就等于把这些职责耦合在一起,一个职责的变化可能会削弱后者抑制这个类完成其他职责的能力。这种耦合会导致脆弱的设计,当变化发生时,设计会遭到
阅读全文