E D R , A S I H C RSS

Full text search for "Visitor"

Visitor


Search BackLinks only
Display context of search results
Case-sensitive searching
  • Gof/Visitor . . . . 44 matches
         = Visitor =
         object structure 의 element들에 수행될 operation 을 표현한다. [Visitor]는 해당 operation이 수행되는 element의 [class]에 대한 변화 없이 새로운 operation을 정의할 수 있도록 해준다.
         우리는 각각의 클래스들로부터 관련된 operation들을 패키징화 하고, traverse 될 (tree 의 각 node들을 이동) abstract syntax tree의 element들에게 인자로 넘겨줄 수 있다. 이를 visitor라고 한다. element가 visitor를 'accepts' 할때 element는 element의 클래스를 인코딩할 visitor에게 request를 보낸다. 이 request 또한 해당 element를 인자로 포함하고 있다. 그러면 visitor는 해당 element에 대한 operation을 수행할 것이다.
         예를든다면, visitor를 이용하지 않는 컴파일러는 컴파일러의 abstact syntax tree의 TypeCheck operation을 호출함으로서 type-check 을 수행할 것이다. 각각의 node들은 node들이 가지고 있는 TypeCheck를 호출함으로써 TypeCheck를 구현할 것이다. (앞의 class diagram 참조). 만일 visitor를 이용한다면, TypeCheckingVisior 객체를 만든 뒤, TypeCheckingVisitor 객체를 인자로 넘겨주면서 abstract syntax tree의 Accept operation을 호출할 것이다. 각각의 node들은 visitor를 도로 호출함으로써 Accept를 구현할 것이다 (예를 들어, assignment node의 경우 visitor의 VisitAssignment operation을 호출할 것이고, varible reference는 VisitVaribleReference를 호출할 것이다.) AssignmentNode 클래스의 TypeCheck operation은 이제 TypeCheckingVisitor의 VisitAssignment operation으로 대체될 것이다.
         type-checking 의 기능을 넘어 일반적인 visitor를 만들기 위해서는 abstract syntax tree의 모든 visitor들을 위한 abstract parent class인 NodeVisitor가 필요하다. NodeVisitor는 각 node class들에 있는 operation들을 정의해야 한다. 해당 프로그램의 기준 등을 계산하기 원하는 application은 node class 에 application-specific한 코드를 추가할 필요 없이, 그냥 NodeVisitor에 대한 새로운 subclass를 정의하면 된다. VisitorPattern은 해당 Visitor 와 연관된 부분에서 컴파일된 구문들을 위한 operation들을 캡슐화한다.
         VisitorPattern으로, 개발자는 두개의 클래스 계층을 정의한다. 하나는 operation이 수행될 element에 대한 계층이고 (Node hierarchy), 하나는 element에 대한 operation들을 정의하는 visitor들이다. (NodeVisitor hierarchy). 개발자는 visitor hierarchy 에 새로운 subclass를 추가함으로서 새 operation을 만들 수 있다.
         VisitorPattern은 다음과 같은경우에 이용한다.
         http://zeropage.org/~reset/zb/data/visitor.gif
          * Visitor (NodeVisitor)
          - declares a Visit operations for each class of ConcreteElement in the object structure. The operation's name and signature identifies the class that sends the Visit request to the visitor. That lets the visitor determine the concrete class of the element being visited. Then the visitor can access the element directly through its particular interface.
          * ConcreteVisitor (TypeCheckingVisitor)
          - implements each operation declared by Visitor. Each operation implements a fragment of the algorithm defined for the corresponding class of object in the structure. ConcreteVisitor provides the context for the algorithm and stores its local state. This state often accumulates result during the traversal of the structure.
          - defines an Accept operation that takes a visitor as an argument.
          - implements an Accept operation that takes a visitor as an argument.
          - may provide a high-level interface to allow the visitor to visit its elements. [[BR]]
         class Visitor {
         class Visitor {
          Visitor ();
          virtual void Accept (Visitor&) = 0;
          virtual void Accept (Visitor& v) { v.VisitElementA (this); }
  • LearningGuideToDesignPatterns . . . . 4 matches
         CompositePattern은 여러부분에서 나타나며, IteratorPattern, ChainOfResponsibilityPattern, InterpreterPattern, VisitorPattern 에서 종종 쓰인다.
         === Visitor - Behavioral ===
         VisitorPattern 은 종종 CompositePattern 과 IteratorPattern 들과 조합되어진다.
         InterpreterPattern 은 복잡하다. 이 Pattern은 FlyweightPattern 와 VisitorPattern 과 관계있으며, 이해를 돕는다.
  • PatternCatalog . . . . 2 matches
          * ["VisitorPattern"]
          * ["Gof/Visitor"]
  • DataCommunicationSummaryProject/Chapter8 . . . . 1 match
         === The Visitors' Location Register(VLR) ===
  • Gof/Composite . . . . 1 match
          * VisitorPattern은 명령들과 Composite 와 Leaf 클래스 사이를 가로질러 분포될 수 있는 행위들을 지역화한다.
  • Gof/Facade . . . . 1 match
         Traverse operaton은 CodeGenerator 객체를 인자로 취한다. ProgramNode subclass들은 BytecodeStream에 있는 Bytecode객체들을 machine code로 변환하기 위해 CodeGenerator 객체를 사용한다. CodeGenerator 클래는 visitor이다. (VisitorPattern을 참조하라)
  • HolubOnPatterns/밑줄긋기 . . . . 1 match
         === Clock 서브시스템 : Visitor 패턴 ===
  • Refactoring/BadSmellsInCode . . . . 1 match
          * StrategyPattern, VisitorPattern, DelegationPattern
  • VisitorPattern . . . . 1 match
         ["Gof/Visitor"]
  • 고슴도치의 사진 마을 . . . . 1 match
         === Visitor ===
  • 박수진 . . . . 1 match
         == Visitor ==
Found 11 matching pages out of 7540 total pages (5000 pages are searched)

You can also click here to search title.

Valid XHTML 1.0! Valid CSS! powered by MoniWiki
Processing time 0.4614 sec