One layer above the core object is the factory code. The factory object provides a basic abstraction of the core XPCOM object.
核心对象的上一层是工厂代码层。工厂对象提供了核心XPCOM对象的基本抽象。
Another approach would be to create a factory class for instantiating the implementations, but there would still be a dependency to the implementation class in your code.
另一种方法是创建用于实例化实现的工厂类,但是您的代码中仍然存在对实现类的依赖。
But forcing the public API to accommodate factory objects or abstract factories, just because the test code wants it to, is the wrong design.
但强迫公用api适应工厂对象或抽象工厂(只因为测试代码要求它这样)是错误的设计。
Because we overrode the factory method to write this test, it turns out that we no longer have any test coverage of the original creation code (which is now inside the base class's factory method).
因为我们覆盖了工厂方法来编写这个测试,所以其结果是:我们的测试不再包括任何原始创建代码(现在它在基类的工厂方法内部)。
In Listing 9, the code that formatted the address is moved to interfaces, implementation classes, and a factory - building the "use interfaces" habit.
在清单9中,格式化地址的代码被移到接口、实现类和工厂中—养成“使用接口”的习惯。
Then the code uses the registered database definition created in the sample to get the database-specific model element factory.
然后,使用前面创建的注册的数据库定义获得特定于数据库的模型元素工厂。
Help those who want to modify the Service Factory source code; doing this is not a straightforward process.
为那些希望修改服务工厂源代码的用户提供方便;目前执行此操作并不是一个简单的过程。
Keep in mind that it is possible for this factory to register and create more than one type of aggregation, but you do this in the body of the code.
请记住,此工厂可以注册和创建多个聚合类型,但这需要在代码体中操作。
The code USES the SCA service manager to locate the business object Factory, which is used to create business objects from XML schemas.
这些代码使用SCA服务管理器查找业务对象工厂(Business Object Factory),后者用于从XML模式中创建业务对象。
As an example, the code in Listing 1 USES an anonymous class to create a Thread Factory.
例如,清单1所示的代码使用一个匿名类创建了一个Thread Factory。
First, you export the code and resources of the widget from Lotus widget Factory as a standard WAR file and deploy it to a WebSphere instance.
首先,您将来自LotusWidgetFactory的小部件的代码和资源导出为标准的WAR文件,并将其部署到WebSphere实例。
Lotus widget Factory is a tool that allows the development of custom enterprise-ready widgets in a visual way, without your having to write code.
LotusWidgetFactory是一个允许您以可视方式开发企业级定制小部件的工具,并且不需要编写任何代码。
The dynamic profiling capability of WebSphere Portlet Factory helps developers to create multiple, highly customized applications from one code base.
WebSpherePortletFactory的动态概要分析功能可以帮助开发人员从一个代码库创建多个、高度自定义的应用程序。
With WebSphere Portlet Factory dynamic profiles, configuration of Web applications becomes very easy and powerful, providing configuration capability without writing code.
使用WebSpherePortletFactory动态概要,Web应用程序的配置变得非常简单、且功能非常强大,无需编写代码就可以进行配置。
So, we use a Factory class (a.k.a. an object factory) to provide the client code with instances of Db2AttendeeDAO and DefaultDAO as needed.
因此我们使用Factory类(又名对象工厂),以根据需要为客户机代码提供Db2AttendeeDAO和 DefaultDAO实例。
There are three ways for client code to access MXBeans: through factory methods, through the platform server, or as proxies.
客户机代码访问MXBean有三种方式:通过工厂方法、通过平台服务器或作为代理。
The client deployment descriptor, in a file called application-client.xml, contains references to the JNDI names of the JMS connection factory and queue that are used in the above code.
客户端部署描述符,在一个称为application-client.xml的文件中,包含对用于上述代码中JMS连接工厂和队列中JNDI名称的引用。
It can also use constructors or factory methods, but most examples you'll see — and the Spring code base itself — focus on setters.
它也使用构造函数和工厂方法,但您会看到的大多数示例和Spring代码基本身还是使用setter。
The code in Listing 2 takes as input the actual XML instance and USES the parse method of the Factory class of AutomobilePolicyDocument to get an instance of AutomobilePolicyDocument.
清单2的代码接受输入的xml实例,并使用AutomobilePolicyDocumentFactory类的parse方法获得AutomobilePolicyDocument实例。
If you open the generated J2C bean, you will see that the JNDI name of the managed connection factory is specified in the doclet tag within the code.
如果您打开生成的J2Cbean,您将看到在代码中被贴以doclet标志的受管的连接工厂的JNDI名字。
This is another rather boring line of code: Just call newTransformer() on your factory and supply the method with the XSL stylesheet you want to use. Listing 4 shows you what to do
这是另一段相当令人厌烦的代码:只在工厂上调用newTransformer(),并为该方法提供要使用的XSL样式表。
The "factory in a box" is realized through the packaging of these features into a set of IBM software products and customized code, which is also referred to as the Multi-source Data Integrator (MDI).
“盒子里的工厂”是通过将这些功能打包为一组IBM软件产品和自定义代码实现的,而这些产品和代码也称为多源数据集成器(Multi - source Data Integrator,MDI)。
While the same functionality can be created by writing code, WebSphere Portlet Factory provides a set of builders that enable the implementation of this function without writing code.
尽管通过编写代码可以创建相同的功能,但是WebSpherePortletFactory提供了一套Builder以支持在不编写代码的情况下实现相应的功能。
The factory returns a stub that uses the endpoint address passed on the method. The code snippet below shows this technique
工厂使用传递到方法的端点地址返回一个存根。
In the sample code (line 5) I retrieve the (default) document factory used to build the document and store it in an instance variable (m_factory) for use by the modify method.
在样本代码(第5行)中,我检索了用于构建文档的(缺省)文档工厂,并将它存储在一个实例变量(m_factory)中以供modify方法使用。
The Web Service Software Factory (also known as the Service Factory) is an integrated collection of tools, patterns, source code and prescriptive guidance.
WebServiceSoft wareFactory(即所谓的服务工厂)是一组集成了工具、模式、源代码和说明性指导的集合。
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页中讨论;有关更多信息,请参阅参考资料一节)。
From there, your code works the same. It USES JNDI to access the JMS connection factory and JMS queue, and USES them to send and receive messages.
从这里,您的代码同样使用JNDI访问JMS连接代理和jms队列,并且使用它们来发送和接收消息。
This code appears to be for internal factory use, perhaps to trace various batches of tubes.
此代码似乎是厂家内部使用,也许是为了跟踪不同批次的管子。
This code appears to be for internal factory use, perhaps to trace various batches of tubes.
此代码似乎是厂家内部使用,也许是为了跟踪不同批次的管子。
应用推荐