图解面向对象设计模式 / 工厂方法模式

版权声明:知识在分享中升华,思想在交流中沉淀,欢迎大家转载。 https://blog.csdn.net/qwfys200/article/details/82382425

图解面向对象设计模式 / 工厂方法模式

Mediator Pattern (Another Name: Virtual Constructor)

Define an interface for creating an object , but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

定义一个用于创建对象的接口,让子类决定实例化哪一个类。Factory Method使一个类的实例化延迟到其子类。

这里写图片描述

参考文献
- Java设计模式/耿祥义,张跃平. ——北京:清华大学出版社,2009.5

猜你喜欢

转载自blog.csdn.net/qwfys200/article/details/82382425
今日推荐