它常常是把有状态类描绘成线程安全的,或者封装非线程安全类以使它们能够在多线程环境中安全地使用的最容易的方式。
It is often the easiest way to render a stateful class thread-safe, or to encapsulate non-thread-safe classes so that they can safely be used in multithreaded environments.
您还应该记得,在方法调用之间保留状态的静态类在默认情况下应该是线程安全的。
You should also remember that static classes that preserve state between method calls should be made thread safe by default.
同时,一些方面将状态存储到本地或者它们建议的类的ITD中。
Also, some aspects store state, either locally or in ITDs on the classes they advise.
为此,您必须将模式需要的所有状态和关系添加到域类中。
To do this, you must add any state and relationships that the pattern requires to your domain classes.
这些工具通常允许创建软件的静态和动态模型,包括类、活动、状态、组件和整体的模型结构(包)。
These tools generally allow for the creation of static and dynamic models of the software, including classes, activity, state, components, and the overall model structure (packages).
该模型定义一组用于存放状态的类,而引擎管理这些信息对象的生命周期。
This model defines a collection of classes for holding the state, and the engine manages the life cycle of these information objects.
将定义通用行为(模板),并提供域特定的行为和域类提供的状态(提供挂钩)。
The generic pattern behavior is defined (the template), with domain-specific behavior and state provided by domain classes (which provide the hooks).
这些不断更改的约束在不考虑状态的“单态”类关系图中容易丢失。
These changing constraints tend to get lost in a "monolithic" class diagram that does not take state into account.
在其中点击,会进入指定类的状态屏幕。
Clicking through takes you to the status screen for a given class.
信息模型包含两种用于存放状态的类。
The Information model has two types of classes for holding the state.
在部署最后一个类时,将状态信息写进该文件。
When you dispose the last class, you will write the status information into the file.
JSF组件类定义UI组件的状态和行为;渲染器定义如何从请求读取组件、如何显示组件——通常通过html渲染。
The JSF component class defines the state and behavior of a UI component; a renderer defines how the component will be read from the request and how it will be displayed — usually though HTML.
SQL状态为00000值就表示成功,类值为01就表示警告,比如数据截断。
An SQL state with a value of 00000 indicates success, whereas a class value of 01 indicates warning conditions, such as data truncation.
这意味着如果应用程序必须在AjaxBean类中维护状态,那么当新请求来临时它就被抹掉了。
This means that if the application has to maintain state in AjaxBean class then it will be erased when a new request comes.
查看这段代码,我发现factors也应当作为类的内部状态而存在,使我可以分解该方法的功能。
Looking at this code suggests that perhaps factors should also exist as internal state to the class, allowing me to break up this method's functionality.
systemstatus类检索系统状态信息。
文档的二进制数据、documentAttributes实例和文档状态是在Document类对象中设置的。
The binary data for the document, the documentAttributes instance, and the document status are set in the Document class object.
statemachine类实际上正是抽象状态机所需要的。
The StateMachine class is really all you need for an abstract state machine.
例如,要发布一个状态消息,需要调用核心Facebook类方法dialog,传递操作stream . publish(参见清单10)。
For example, to publish a status message, you make a call to the core Facebook class method dialog passing the action stream.publish (see Listing 10).
无状态会话Bean使用 DBHelper 类(使用了JDBC声明)执行数据库事务。
The stateless session bean uses the DBHelper class (JDBC statements are used) to perform the database transaction.
publicvoidsetDefaultAssertionStatus(booleanenabled) :该方法设置由类装入器装入的包和类的缺省状态。
public void setDefaultAssertionStatus(boolean enabled): This method sets the default status for packages and classes loaded by the class loader.
图13:部分UML设计类图表(时间表和新状态)。
Figure 13: Partial UML design class diagram (timesheet and new states).
对于新手,Scala中的数组实际上就是泛型类,没有增加“内置”状态(至少,不会比scala库附带的其他类多)。
For starters, arrays in Scala are effectively generic classes, with no "built-in" status accrued to them (at least, no more than any other class that ships with the Scala library).
有些类保留从一个方法调用到下一个方法调用的状态信息,要在实践中使这样的类成为线程安全的是困难的。
Some classes retain state information from one method invocation to the next, and it is difficult to make such classes thread-safe in any practical way.
虽然对于所有机器来说没有一种理想状态,但对于给定的机器类有一个要达到的理想状态。
It follows, then, that while there is no ideal state for all machines, there is an ideal state to be achieved for a given machine class.
图5显示除确认状态之外的所有状态的组合类关系图。
Figure 5 shows a combined class diagram for all the states except the confirmation ones.
健康指示器可以测定某些特定数据库对象类的状态。
A health indicator measures the health of some particular class of database objects.
一旦您实现了在方法调用之间保持状态的重要类,该类的使用者就会希望了解有关线程安全和性能的详细信息。
As soon as you implement a nontrivial class maintaining state between method calls, consumers of the class will want to know details about thread safety and performance.
至于类如无线信号、电池电量等状态信息则被显示在其中一块屏幕的边沿。
Statuses, like wireless signal and battery life, are displayed along the rim of one of the screens.
至于类如无线信号、电池电量等状态信息则被显示在其中一块屏幕的边沿。
Statuses, like wireless signal and battery life, are displayed along the rim of one of the screens.
应用推荐