摘要:
Design Principle(Open-Closed Principle)Classes should be open for extension, but closed for modification.The Decorator Pattern attaches additional responsibilitis to an object dynamically.Decorator provide a flexible alternative to subclassing for extending functionality.public abstract class Bevera 阅读全文
摘要:
The Observer Pattern defines a one-to-many dependency between objects so that when oneobject changes state, all of its dependents are notified and updated automatically.The Observer Pattern defines a one-to-many relatioship between objects.Design PrincipleStrive for loosely coupled designs between o 阅读全文
摘要:
Design Principle:Identify the aspects of your application that vary and sparate them from what stays the same.Program to an interface, not an implementation.Favor composition over inheritanceThe Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable.St 阅读全文