Advertisement

设计模式之工厂方法模式研究

阅读量:

软件构造实验一:使用工厂方法模式设计“某系统日志记录器系统”。

  • 首先需要知道什么叫工厂方法模式,它是24个设计模式中的其中一个设计模式。工厂方法模式简称为工厂模式( Factory Pattern),它的定义是看下边引用(摘抄于知乎):

Pattern of factory method, essentially, is a modification designed to address the shortcomings of the basic factory pattern. For instance, when a simple factory pattern is used to produce an airplane, it can generate models like helicopters, fighter jets, and Boeing 747. However, if we need to introduce a new type of aircraft, such as a water plane, we would have to modify the source code—specifically, altering the factory's source code. This addition of busi

全部评论 (0)

还没有任何评论哟~