Rather than directly instantiating an object of a plug-in class, plug-ins are attached to a component using the "plugins" configuration option for that component.
插件的使用并不是直接初始化插件类的一个对象,而是使用该组件的“plugins”配置选项将插件附加到这个组件上。
First, we create an NHibernate Configuration object. Then we pass it the class mappings from the mapping files.
首先我们创建一个NHibernate的Configuration对象,通过它来实现从映射文件中映射类。
In both cases you need to declare the dependency (e.g. using the Spring configuration file) and add a corresponding constructor or mutator method to the dependent object class.
在这两种情况下,您都需要声明依赖项(例如使用Spring配置文件),并向依赖对象类添加对应的构造函数或mutator方法。
This pattern is ideal for the configuration class because there should only be one configuration object for the application.
这种模式对于configuration类是十分理想的,因为应用程序应当仅有一个配置对象。
The TypeGetter class, illustrated in Listing 5 and Figure 22, is responsible for retrieving a configuration field of a particular type from a Configuration object
图5和清单22 中显示的TypeGetter类负责从Configuration对象中获取特定类型的配置字段
Now, any attempt to instantiate an object of type Configuration results in an error because the class is considered abstract and incomplete.
现在,所有要将configuration类型的对象实例化的尝试都会出错,因为系统认为该类是抽象的并且不完整。
Now, any attempt to instantiate an object of type Configuration results in an error because the class is considered abstract and incomplete.
现在,所有要将configuration类型的对象实例化的尝试都会出错,因为系统认为该类是抽象的并且不完整。
应用推荐