· The Factory Pattern is used to choose and return an instance of a class
from a number of similar classes based on data you provide to the
factory.
· The Abstract Factory Pattern is used to return one of several groups of
classes. In some cases it actually returns a Factory for that group of
classes.
· The Builder Pattern assembles a number of objects to make a new
object, based on the data with which it is presented. Frequently, the
choice of which way the objects are assembled is achieved using a
Factory.
· The Prototype Pattern copies or clones an existing class rather than
creating a new instance when creating new instances is more expensive.
· The Singleton Pattern is a pattern that insures there is one and only one
instance of an object, and that it is possible to obtain global access to that
one instance.
SUMMARY OF CREATIONAL PATTERNS
最新推荐文章于 2019-08-06 15:21:09 发布