不同设计模式解决的问题(完善中。。)

具体的设计模式,网上有很多介绍。本人参见 journaldev

模式 解决问题
Builder Too Many arguments to pass from client program to the Factory class
Factory when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class
Prototype When u need clone an existing object (shallow or deep copy)
Strategy Define multiple algorithms and let client application pass the algorithm to be used as a parameter
Decorator modify the functionality of an object at runtime
Composite When we need to create a structure in a way that the objects in the structure has to be treated the same way
Bridge Using abstract class replacing implement class to decouple
Facade Unify a set of interfaces in a subsystem
Template method define common functions in abstract class for all sub class

你可能感兴趣的:(设计模式,设计模式)