... Factory Method Pattern 工厂方法模式 ; 工厂模式 ; 工厂办法模式 The Factory Method 工厂模式 Simple Factory Method 简单工厂模式 ...
基于8个网页-相关网页
The Factory Method Pattern 工厂方法模式
Assure that the factory method is accessible to the target object and its subclasses.
确保目标对象及其子类可以访问工厂方法。
You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
Apply the Extract method refactoring to this creation code, creating the factory method (discussed on page 110 of Fowler's book; see the Resources section for more information).
将抽取方法重构应用于这个创建代码,创建工厂方法(在Fowler书籍的第110页中讨论;有关更多信息,请参阅参考资料一节)。
应用推荐