Figure 6: State pattern and participating classes within the RSA pattern explorer.
图6:state模式和RSA模式浏览器中参与的类。
The state pattern is a similar to the command pattern, but the intent is quite different.
状态模式类似于命令模式,但是意图截然不同。
For example, according to the pattern catalog, the State pattern is often related to Flyweight and Singleton [GoF].
例如,通过模式目录,State模式经常涉及到Flyweight和Singleton [g oF]。
Now look at Listing 8, which has the same logic for handling the robot's states, but this time puts the logic into the state pattern.
现在查看清单8,其中提供了相同的逻辑处理机器人的状态,但是这一次把逻辑放入状态模式。
For instance, with slight modification you can introduce the state pattern with some persistence to keep track of conversational state.
例如,只需稍作修改,就可以为state模式引入持久性,以跟踪会话状态。
One of the benefits of applying the state pattern is that it can resolve the if-statement situation difficulty shown in Figure 3 by isolating the various states.
使用State这个模式的一个好处是,它可以通过孤立各种状态来分解图3中if语句的情景。
You now have the best of both worlds: you are leveraging the navigational state pattern defined via the JSR 286 public render parameters and you can easily set parameters on a specific URL.
现在两全其美了:您可以利用JSR 286公共呈现参数定义的导航状态模式,并且您也可以轻松地在一个指定url中设置参数。
This pattern requires that the value being published be effectively immutable — that its state not change after publication.
这个模式要求被发布的值是有效不可变的——即值的状态在发布后不会更改。
Because the pattern says that it "Allows an object to alter its behavior when its internal state changes."
因为模式要求它“允许一个对象在它的内部状态变化的时候改变它的行为。”
To do this, you must add any state and relationships that the pattern requires to your domain classes.
为此,您必须将模式需要的所有状态和关系添加到域类中。
Perhaps the most important pattern for increasing horizontal scalability in the cloud is the minimization of mutable state.
在云中增加水平可伸缩性的最重要模式可能就是最大限度地减少可变状态。
The idea that these endpoints can be devices, services, applications etc. that can synchronize resource state over HTTP using GET semantics will only make variations of this pattern more ubiquitous.
如果加上端点可以是各种能够通过使用HTTP的GET语义来同步资源状态的设备,服务,应用程序等等这种思想,这种模式将会更加普遍适用。
Developers have used the finite state machine design pattern to organize event-driven programs like this.
开发人员可以使用有限状态机设计模式来组织这样的事件驱动程序。
The finite state machine pattern used to design this behavior makes its logic transparent.
设计此行为所用的有限状态机模式使逻辑清晰透明。
They don't want their teams trying to figure out what pattern is best to use when there is a need to separate externalized information from its internal state.
他们不希望当有需求要分离外化的信息及其内部状态的时候,项目组尝试着去估计应用哪一种模式最好。
One of the easiest ways to create an SIP-enabled service is to use the representation state transfer (REST) design pattern through utilizing HTTP in a converged HTTP and SIP application.
在创建启用SIP的服务时,最简单的方法之一是利用聚合HTTP和SIP应用程序中的HTTP来使用代表性状态传输(REST)设计模式。
Church and state, and the rise of the latter, established a long-lasting pattern of interaction.
教会和国家,及后者的兴起,建立了传承久远的社会模式。
FOREST is a GET-only REST Integration Pattern defined simply as: a resource's state depends on the state of other resources that it links to.
FOREST是一个只有GET的REST集成模式,简单的定义为:一个资源的状态依赖于它所链接的其它资源的状态。
Conversations: a conversation is a special form of interaction pattern where the parties involved have awareness of previously exchanged messages (that is, the parties hold state information).
对话:对话是一种特殊的交互模式形式,其中涉及的各方都知道之前交换的消息(即各方均保留状态信息)。
Clinton contends Obama has a pattern of avoiding difficult issues, beginning with his record as a state senator in Illinois.
克林顿争辩说,奥巴马在棘手问题上有一种刻意回避的模式,这从他担任伊利诺伊州的州议员时就开始了。
Once you've put yourself in a pattern of rejecting all limitation, you've embraced a fixed state of being.
一旦陷入拒绝所有限制的模式,你就会信奉一种固定的生命形态。
Once you've put yourself in a pattern of rejecting all limitation, you've embraced a fixed state of being. Your no-limit policy has deceptively limited you.
一旦陷入拒绝所有限制的模式,你就会信奉一种固定的生命形态。你的无限制规则迷惑地限制了你。
Representational State Transfer (REST) is a software architecture pattern and invocation style for accessing and updating resources on a network.
具象状态传输(Representational State Transfer,REST)是用于访问和更新网络资源的软件架构模式和调用样式。
This pattern can be extended to state flags that can change back and forth, but only if it is acceptable for a transition cycle (from false to true to false) to go undetected.
这种模式可以扩展到来回转换的状态标志,但是只有在转换周期不被察觉的情况下才能扩展(从false到true,再转换到false)。
Hence, the design pattern for invoking a human task from the business state machine is as follows.
因此,从业务状态机调用人工任务的设计模式如下所示。
In the widely used traditional DAO/Repository pattern, DAOs have the responsibility to perform persistence operations, which are purely behavioral, and entities are supposed to hold state.
从广泛使用的DAO/Repository模式的角度来说,DAO只负责执行持久化操作,而实体则只维护其状态。
Because of pattern matching order, we can now state that no users contained in the DenyUsers list will be granted access, only the user alpha will be granted access.
考虑到模式匹配次序,我们现在可以声明,对DenyUsers列表中包含的用户都不授予任何访问权,只允许用户alpha访问。
The generic pattern behavior is defined (the template), with domain-specific behavior and state provided by domain classes (which provide the hooks).
将定义通用行为(模板),并提供域特定的行为和域类提供的状态(提供挂钩)。
What we have achieved so far is a lean and mean implementation of a DAO pattern which allows the persistence of 'state-only' entities.
到目前为止,我们精简了DAO模式的实现,该实现只能持久化实体的状态。
What we have achieved so far is a lean and mean implementation of a DAO pattern which allows the persistence of 'state-only' entities.
到目前为止,我们精简了DAO模式的实现,该实现只能持久化实体的状态。
应用推荐