📜  工厂设计模式 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:38.130000             🧑  作者: Mango

代码示例2
Factory pattern 
- a DP (design pattern) that may be the chosen solution approach by an app architect. 
- there are factory functions and there are factory classes. 
- - A factory class could be used to return a customized object (based on args)

In terms of code readability, factory pattern reveals the exact nature of the new object 
we are creating. Also using this DP makes it easier to organize back-end development.