清单2:在方法参数中使用工厂方法。
使用工厂方法设计模式的正确方法是什么?
What's the right way to use the Factory method design pattern?
然后再使用工厂方法模式,这样耦合度就与界面相关联了。
Then, I use the factory method pattern so that the coupling is with the interface.
对各个复合文件工件进行检查,然后使用工厂方法在内存中实例化不同对象。
The various composite file artifacts are inspected, and factory methods help instantiate the various objects in memory.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
应用推荐