最简单的方法就是在工厂模式中把代理类的建立封装起来。
The simplest approach is to encapsulate the creation of the proxy class within the Factory pattern.
对于这个示例来说,这个存储器是由一个简单且短暂的散列表实现的,并由一个生成实现类的工厂提供(清单3和清单4)。
For this example, this store is implemented with a simple, ephemeral hash table and is provided with a factory for generating the implementation class (Listings 3 and 4).
工厂类本身用于获得Transformer的实例(在下一小节中讨论),并执行简单配置。
The factory class itself is used to get an instance of Transformer (discussed in the next subsection) and to perform simple configuration.
如果框架与类混杂,可以添加一个工厂类,将它们装配到通用组合中,并为通用情况提供一个更简单的API。
If the framework gets cluttered with classes, you can add a factory class that assembles them into common combinations and provides a simpler API for common cases.
在客户端环境中使用WebSphereMQ消息提供程序连接工厂时,类加载考虑事项比服务器环境要简单地多。
The class loading considerations when using WebSphere MQ messaging provider connection factories are simpler in the client environment than they are in the server environment.
这与调用基类的工厂方法并断言返回对象具有正确类型一样简单。
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.
唯一可靠的方法就是也出口类工厂函数,一个简单的函数,使用新的操作符来创建对象并返回的指针。
The only reliable way to do it is to also export a class factory function, a simple function that USES the new operator to create the object and return the pointer.
类工厂,加载和卸载代码,和注册支持只是简单地让你调整类名称和GUID。
The class factory, the loading and unloading code, and registration support simply require you to adjust the name of the class and the GUIDs involved.
类工厂,加载和卸载代码,和注册支持只是简单地让你调整类名称和GUID。
The class factory, the loading and unloading code, and registration support simply require you to adjust the name of the class and the GUIDs involved.
应用推荐