The visitor pattern is illustrated in Figure 2.
访问器模式如图 2 所示。
How to handle collections with the Visitor pattern?
如何与访问者模式处理收藏?
To process the resources, the builder uses the visitor pattern.
为了处理资源,构造器使用了访问器模式。
Thus, in Jam, the visitor pattern can't be used with mixins.
因此,在Jam 中,访问者模式不能和mixin 一起使用。
The question is, can we implement the Visitor pattern without recursion?
问题在于,我们能否在不使用递归的前提下实现访问者模式?
Another aspect of the Visitor pattern not closely examined here is iteration order.
就访问者模式而言,本文未加详述的另一各方面就是迭代顺序。
The visitor pattern is a simple technique to process arbitrary data structures.
访问者模式是一种处理任意数据结构的简单技术。
Implements the visitor pattern for expressions that do not produce a result value.
实现不生成结果值的表达式的访问者模式。
All bytecode scanning detectors are based on the visitor pattern, which FindBugs implements.
所有字节码扫描检测器都基于visitor模式,FindBugs实现了这个模式。
This serves as a useful base case, similar to a base Visitor class in the classic Visitor pattern.
这将作为一种有用的基本用例,类似于经典访问者模式中的基本Visitor类。
In each case, I've found that the Visitor pattern is a reliable tool for manipulating trees of data.
无论使用哪种语言,访问者模式都是操作树形数据的一种可靠工具。
Curried closures can be used to mimic the essential elements of the Visitor pattern, as we showed in the Library example.
Curry过的闭包可以用来模拟Visitor模式的基本元素,正如在Library例子中显示的。
The Visitor pattern creates a scenario where adding operations (new visitors) over the set of existing data types is easy.
访问者模式将创建一个场景,简化对现有数据类型集合添加操作(新访问者)的过程。
Consider the visitor pattern in which a visitor class is defined with a for method for each class in a composite hierarchy.
请考虑访问者模式,其中用for方法为复合层次结构中的每个类都定义了访问者类。
The visitor pattern implements a walk through a hierarchy in which the visitor specifies an operation to apply to the nodes.
访问器模式实现了层次结构的遍历,并将访问器指定的操作应用于每个节点。
Adding new data types (classes) with visitors is difficult, however, as the visitor pattern requires a visit method for all concrete types.
然而,通过访问者添加新数据类型(类)较为困难,因为访问者模式要求所有具体类型都具有一个visit方法。
The Visitor pattern is often used to separate a data structure (the tree, in this case) from the algorithms that operate over the data structure.
访问者模式往往用于将数据结构(本例中是树)与通过数据结构操作的算法分离开来。
Instead the form or structure of the class files are analyzed to determine the program's intent, often using the Visitor pattern (see Resources).
不是通过分析类文件的形式或结构来确定程序的意图,而是通常使用Visitor模式(请参阅参考资料)。
This article has just scratched the surface of using zippers in the Visitor pattern; the point of it is to whet your appetite for further exploration.
这篇文章仅仅是涉及了在访问者模式中使用zippers的一些浅显问题;目的在于激发您进一步探索的兴趣。
Leveraging Clojure's functional programming tools to implement the Visitor pattern is one way to get around this incidental complexity, while still programming on the JVM.
利用Clojure的函数式编程工具来实现访问者模式是消除这种附带的复杂性的一种方法,而且仍然是在JVM上编程。
Another design pattern that lends itself well to DEBA is the Visitor pattern, which externalizes an operation that will be performed on another object, a group of objects, or a structure of objects.
另外一种可用于DEBA架构的设计模式是Visitor(访问者)模式,将操作外部化,可以对其他对象、对象组或者对象结构执行这些操作。
The Visitor design pattern is used to separate the exception hierarchy from the code that builds the fault details.
Visitor设计模式用于把异常层次与构建故障详细信息的代码分开。
It is not hard to integrate a pattern-matching library with the tree visitor to get to a point where visitors can leverage tree patterns.
您可以轻松集成模式匹配库与树访问者,使访问者能够利用树模型。
Guan Lingcun to meet its unique pattern of every visitor, I suddenly liked the shelter in the mountains deep in the village.
官岭村以它独特的格局迎接每一个来客,我一下子就喜欢上了这个遮蔽在大山深处的村落。
Guan Lingcun to meet its unique pattern of every visitor, I suddenly liked the shelter in the mountains deep in the village.
官岭村以它独特的格局迎接每一个来客,我一下子就喜欢上了这个遮蔽在大山深处的村落。
应用推荐