清单2:在方法参数中使用工厂方法。
重构:抽取和覆盖工厂方法。
使用静态工厂方法创建一个msg对象。
用工厂方法替换构造函数。
Convert Property to Auto-Property Introduce Field Replace Constructor with Factory method.
确保目标对象及其子类可以访问工厂方法。
Assure that the factory method is accessible to the target object and its subclasses.
从工厂方法到抽象工厂。
“工厂方法”对于软件开发来说注定要失败。
The "factory approach" to software development is bound to fail.
抽象工厂与工厂方法:组成与实现?
Abstract Factory vs Factory method: Composition vs Inplement?
工厂方法返回的类用于一个特定于服务的适配器。
The class returned by the factory method is an adapter to a particular cloud service.
使用工厂方法设计模式的正确方法是什么?
What's the right way to use the Factory method design pattern?
唯一的特别之处在于几个方便操纵字段的静态工厂方法。
The only special part is several convenient static factory methods for manufacturing fields.
然后再使用工厂方法模式,这样耦合度就与界面相关联了。
Then, I use the factory method pattern so that the coupling is with the interface.
本节将循序渐进地描述“抽取”和“覆盖”工厂方法重构。
This section offers a step-by-step description of the Extract and Override factory method refactoring.
该工厂方法通过将这项工作委托给服务层来实例化课程对象集合。
This factory method instantiates the collection of course objects by delegating the work to the service layer.
这与调用基类的工厂方法并断言返回对象具有正确类型一样简单。
This can be as simple as invoking the base class's factory method and asserting that the returned object is of the correct type. For example.
这个工厂类将变成由相互依赖的工厂方法构成的巨型蜘蛛网。
This factory is going to become a huge spiderweb of interdependent factory methods!
对各个复合文件工件进行检查,然后使用工厂方法在内存中实例化不同对象。
The various composite file artifacts are inspected, and factory methods help instantiate the various objects in memory.
而工厂方法模式,顾名思义,定义的是一个用来大量产出对象的方法的实现。
The factory method pattern, as its name implies, defines the implementation of a method used to churn out objects.
可选的:创建单元测试以确保原始目标对象的工厂方法仍返回正确的非模仿对象。
Optional: create a unit test to assure that the original target object's factory method still returns the correct, non-mock object.
您可以在应用程序需要创建其类型依赖于子类的实现的对象时,使用工厂方法模式。
You use the factory method pattern when an application needs to create objects whose type depend on the implementation of subclasses.
这里的解决方案是为要读取的条目提供一个带工厂方法的方法参数,如清单2所示。
The solution here is to provide a method parameter with a factory method for the items to read, as shown in Listing 2.
用这种方式,静态工厂方法返回的对象可以实现建立代理时所定义的任意数量的接口。
In this way, the object returned from the static factory method could implement any number of interfaces defined when I create the proxy.
单例、生成器和工厂方法设计模式被视为是创建型的模式,因它们可协助对象的构建。
The singleton, builder, and factory method design patterns are considered creational patterns, as they assist in the construction of objects.
客户机代码访问MXBean有三种方式:通过工厂方法、通过平台服务器或作为代理。
There are three ways for client code to access MXBeans: through factory methods, through the platform server, or as proxies.
你可以直接实例化一个CipherService-没有奇怪或让人混乱的工厂方法;
You can instantiate a CipherService directly - no strange or confusing factory methods.
它也使用构造函数和工厂方法,但您会看到的大多数示例和Spring代码基本身还是使用setter。
It can also use constructors or factory methods, but most examples you'll see — and the Spring code base itself — focus on setters.
XAML 2009将完全支持泛型、非默认构造方法、工厂方法、内建类型并且可以定义新的属性。
In XAML 2009 we see full support for generics, non-default constructors, factory methods, built-in types, and defining new properties.
实际上,许多人已经用工厂对象来着手这种方法,而不是用工厂方法—我们以前是这样做的,但很快就放弃了。
In fact, many would have started this approach with a factory object, rather than a factory method — we did, but soon backed away.
实际上,许多人已经用工厂对象来着手这种方法,而不是用工厂方法—我们以前是这样做的,但很快就放弃了。
In fact, many would have started this approach with a factory object, rather than a factory method — we did, but soon backed away.
应用推荐