Factory Method Factory Method

"Object Creation" mode

  By "object creation" mode to bypass the new, tightly coupled to avoid the object creation (new) in the process leading to the (concrete class since), to support a stable object created. It is the first portion after the work of abstract interfaces.

  Typical Mode: Factory Method, Abstract Factory, Prototype, Builder

 

Motivation (Motivation)

  In software systems, often faced with the creation of objects work; due to changes in demand, the need to create specific types of objects often change.

  How to respond to this change? How to create a method (new) bypassing the conventional object to provide a "package mechanism" to avoid tightly coupled client and this "specific object creation work"?

Guess you like

Origin www.cnblogs.com/Maurice-code/p/11604481.html