The platform calls this class to perform initialization and cleanup.
平台调用这个类来执行初始化和清理工作。
To do this, add an instance of the offline service helper and an initialization method to the class you created previously as shown in listing 2.
要实现此目的,可以向之前所创建的类中添加离线服务帮助器的一个实例和一个初始化方法,如清单2所示。
This refactoring of the class also improves the code so that we have separated the initialization code from the object construction code.
类的这种重构也会改进代码,因为我们将初始化逻辑从对象的构造函数分离出来了。
This function usually performs some initialization routines such as setting default values of class properties.
该函数通常执行一些初始化例行程序,比如,设置类属性的默认值。
Another solution is to move that field to a separate class, where the construction process can guarantee that the correct initialization data is supplied by the user.
另外一个解决方案是把这个字段转移到一个单独的类中,这样构造过程可以保证用户可以提供正确的初始化数据。
Manage the JSP class lifecycle, from initialization to destruction.
管理jsp类的生命周期,从初始化到破坏。
Since there is no way to know when this class will be referenced and since it has no explicit initialization methods, this appears legitimate.
由于没有办法可以知道这个类什么时候会被引用,并且因为没有显式的初始化方法,这样做看起来是合法的。
This error is thrown during the initialization phase of class loading.
这个错误在类装入的初始化阶段抛出。
You feel that a custom metaclasses is overkill for the simple job of class initialization, and you would rather use a simpler solution.
您觉得对于类初始化这类简单的工作使用自定义元类是杀鸡用牛刀,所以想要使用一种更为简单的解决方案。
Next is the class loader cache initialization.
下一步是类装载器缓存初始化。
Three required attributes for a rule are: 1 fully qualified name, 2 implementation class, and 3 initialization properties.
规则的三个必要的属性是:1完整的限定名,2实现类,3初始化属性。
Now notice that this initialization script not only imports the class in order to make it accessible to other parts of Zope, it also registers it for "addability".
现在请注意这个初始化脚本不仅导入了那个类,使它可被Zope的其它部件访问,而且还将该类注册成具有“可添加性”。
The initialization code in Listing 2 is part of a class that uses setter injection for DI.
清单2中的初始化代码是一个类的一部分,它使用setter注入进行DI。
In Listing 9, the BrowserModel class performs its initialization within the init method.
在清单9中,browsermodel类在init方法中执行自己的初始化。
By deferring construction and initialization to the Appointment class, I make it easier to separate additional wrapping behavior (such as persistence).
通过延迟对appointment类的构建和初始化,简化了对附加包装行为(比如持久性)的分离。
With all this machinery defined, customizing class initialization becomes rather straightforward, and elegant looking. It might be something as simple as
使用所有这些定义的方法,自定义类初始化将变得更加简单和美观。
Reduce class loading during plug-in initialization.
减少插件初始化时加载的类的数量。
Class initialization Any type of regular or real-time thread can initialize a class, including a NHRT, which can cause unexpected MemoryAccessError.
类初始化任何类型的常规或实时线程都可以初始化类,包括NHRT(它可能导致意外的MemoryAccessError)。
The com.ibm.lpex.preload extension point allows the LPEX Editor plug-in to record, upon initialization, the class loaders of all declaring client plug-ins.
preload扩展点允许LPEXEditor插件在初始化后记录所有声明客户机插件的类加载器。
In case of smaller schema (determined based on the computation of total number of classes, attributes, and so on), the initialization code is generated within the Package class itself.
在较小的schema情况下(取决于类、属性等的总数的估计),该初始化代码在包类本身中生成。
In some initialization code, open the ActiveRecord base class and add your acts_as_ module.
在某些初始化代码中,打开ActiveRecord基类并添加acts_as _模块。
Both support the idea of deferred initialization, also known as futures, the former is a class and the later a lightweight and slightly less safe structure.
这两者都体现了延迟初始化的特性(因此又被称为futures)。前者是一个类,而后者则是一个轻量的,但并非“绝对”线程安全的结构。
Move the line that initializes account from the test method to setUp , then delete the declaration and initialization from the other test method. Your test class should now look like Listing 8.
将初始化account的代码从测试方法移到setUp,然后删除其它测试方法中的声明和初始化。
If the table doesn't exist, it invokes the database initialization code, ResourcesDatabaseInitializer, which in this example is a utility class that initializes the database.
如果该表不存在,则它调用数据库初始化代码ResourcesDatabaseInitializer,该代码在此示例中是初始化数据库的实用程序类。
A generic technique to avoid class-loading delays during the time-sensitive parts of your application is to preload classes during application startup or initialization.
一种在应用程序的时间敏感型部分避免类加载延迟通用技术是,在应用程序启动或初始化期间预先加载类。
Instead of double-checked locking, use the Initialize-on-demand Holder Class idiom, which provides lazy initialization, is thread-safe, and is faster and less confusing than double-checked locking.
不使用双重检查锁定,而使用Initialize - on - demandHolderClassidiom,它提供了迟缓初始化,是线程安全的,而且比双重检查锁定更快且没那么混乱。
There are subtle differences between copy - and direct-initialization when initializing objects of a class type.
当初始化类类型对象时,复制初始化和直接初始化之间的差别是很微妙的。
For objects of a class type, there are initializations that can be done only using direct-initialization.
对类类型的对象来说,有些初始化仅能用直接初始化完成。
For objects of a class type, there are initializations that can be done only using direct-initialization.
对类类型的对象来说,有些初始化仅能用直接初始化完成。
应用推荐