摘要: FacadeFacade provides a new mechanism to combine the sub-systems and eventually provides an uniform interface to the client, which is a higher encapsulation and makes the sub-systems be used more easily, what's more? the sub-systems can run by themself and can be used independently.This pattern
阅读全文
摘要: PrototypeUse the current instance of a type to create a same instance with the Clone but not new.When we use this patternI have no idea now, need to dig more in the future.Roles in this patternPrototype: define an interface used to clone itselfConcretePrototype: implement the interface of the Protot
阅读全文
摘要: SingletonSingleton is simple, i think most of coders have used it in our system. Which guarantees that a class only has one instance, and provides a global entry to the client to access it.How do we make this happen, a global entry. and we should prohibit any possibilities to initialize it. Singleto
阅读全文
摘要: DecoratorAdd some new features to the objectdynamically, it is more flexible than theinheritance, the original component doesn't need to have plenty of functions at the first time, but has only very frequent operations. The decorator is designed to add any other additional operations to the orig
阅读全文
摘要: ObserverThe different objects got some dependency with each others. when the state of one of them is changed. all other dependent object will be notified and updated by some predefined rules.It is like the Publish-Subscribe mode, when the publisher is changed, all the subsciber will be changed autom
阅读全文
摘要: CompositeComposite pattern is dedicated to resolve the whole and part issue in application. The whole can be parted into different parts and the parts can be composited into a very whole, to resolve the whole-part issue.When we use this patternif you want to express the whole-part hierarchycircumsta
阅读全文
摘要: Adapter patternAdapter is designed to change an interface to another interface expected by client. which makes the uncompatible types work together.When we use this patternWe want to reuse the code designed before, which has the similar functionality to our current situation. but they are not compat
阅读全文