visitor-pattern Questions

1

Solved

I'm currently trying to develope a JavaScript Compiler with the help of an Antlr4 Visitor. I've got this already implemented with Java but cannot figure out how to do this in JavaScript. Probably s...
Octahedrite asked 16/2, 2016 at 14:18

4

Solved

Is it generally acceptable to allow a Visitor to modify state of the Receiver, or should that be a Command pattern instead?
Advocation asked 18/5, 2010 at 13:54

2

Solved

I'm in a class where we just learned about these design patterns. However I couldn't see any difference between them. They sound just like the same, creating concrete classes over the abstract one....

3

Solved

Is it acceptable that visitor change the state of object in which it operates? These kind of operation are not considered as anti patterns?
Tonsorial asked 30/12, 2015 at 23:45

4

Solved

I'm new in this pattern , could please someone help me in it? I got an Object like this : public class Object { public string Name { get; set; } public object Value { get; set; } public List&...
Stalag asked 4/10, 2015 at 11:48

4

Solved

I want to know whether the below is an acceptable use of the visitor pattern. I feel a little uncomfortable returning from an Accept() or Visit() call - is this an appropriate usage of this pattern...
Hyperbolic asked 3/2, 2009 at 18:30

6

I have an IComposer interface in my c# project: public interface IComposer { string GenerateSnippet(CodeTree tree); } CodeTree is a base class that contains a List<CodeTree> of classes th...
Convocation asked 21/12, 2015 at 6:9

1

Solved

I need a container that works like a ditionary but where the type of data (TValue) change from one key to the other. I also need to iterate trough it.
Gutty asked 14/9, 2015 at 9:16

4

Solved

I'm working on a small game template, with a world comprised of nodes like so: World |--Zone |----Cell |------Actor |------Actor |--------Item Where a World can contain multiple Zone objects, a ...
Emyle asked 20/7, 2015 at 22:53

4

I read quite a lot about the visitor pattern and its supposed advantages. To me however it seems they are not that much advantages when applied in practice: "Convenient" and "elegant" seems to me...
Marci asked 26/11, 2013 at 13:59

3

Solved

Consider the following visitor for a simple language interpreter. public interface Visitor{ void visit( VarStat vs); void visit( Ident i); void visit( IntLiteral a); void visit( Sum s); } Fo...
Takishatakken asked 15/5, 2015 at 12:11

1

Solved

I used the Visitor design pattern to solve one of the issues within our system. As a reference how to implement it I used DoFactory site and This YouTube video. In DoFactory example, the Visitor u...
Rage asked 12/4, 2015 at 18:36

6

Solved

I'm really confused about the visitor pattern and its uses. I can't really seem to visualize the benefits of using this pattern or its purpose. If someone could explain with examples if possi...
Haematin asked 8/4, 2010 at 23:41

2

Solved

I have to design a solution for a task, and I would like to use something theoretically similar to C#'s ExpressionVisitor. For curiosity I opened the .NET sources for ExpressionVisitor to have a l...
Johen asked 22/1, 2015 at 14:41

6

Solved

I have following C# code in .Net 4.0. It requires a type casting of IBusiness to IRetailBusiness. //Type checking if (bus is IRetailBusiness) { //Type casting investmentReturns.Add(new RetailInv...

4

Solved

With Delphi 2009 Enterprise I created code for the GoF Visitor Pattern in the model view, and separated the code in two units: one for the domain model classes, one for the visitor (because I might...
Kemper asked 1/3, 2010 at 14:9

1

Solved

As I understand it, in the typical specification of the Visitor pattern, it is the visited objects that decide how to traverse, and generally, they only support one traversal order. (See, e.g., her...
Chablis asked 4/7, 2014 at 2:13

1

Solved

I'm trying to write a code translator in Java with the help of Antlr4 and had great success with the grammar part so far. However I'm now banging my head against a wall wrapping my mind around the ...
Pietrek asked 12/6, 2014 at 13:37

1

Solved

Visitor pattern (double dispatch) is a very useful pattern in its own rights, but it has often been scrutinized of breaking interfaces if any new member is added to the inheritance hierarchy, which...
Epiphenomenon asked 29/3, 2014 at 21:28

4

I imagine this question or variations of it get passed around a lot, so if what I'm saying is a duplicate, and the answers lie elsewhere, please inform me. I have been researching game engine desi...
Mailman asked 14/9, 2010 at 3:17

2

Solved

I'm trying to use ASTs with ANTLR4, with this files: Builder.java import org.antlr.v4.runtime.ANTLRInputStream; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CommonTokenStre...
Grudging asked 2/2, 2013 at 23:42

1

I am a beginner of antlr. I was trying to use visitor in my code and following the instruction on the net. However, I found out that the visitor was not entering the method I create at all. May any...
Wuhu asked 20/10, 2013 at 1:36

2

Solved

So I've read up all the documentation about the Visitor pattern, and I'm still mightily confused. I've taken this example from another SO question, could someone help me understand? For instance wh...
Trestle asked 12/4, 2012 at 0:58

2

Solved

For implementing a Visitor Pattern in Java you can use Overriding or Overloading. Does the choice depends or is it always preferable to choose one of the two? Because I don't see no disadvantages. ...
Centerpiece asked 22/12, 2013 at 14:57

1

Solved

Good morning stackoverflow, I'm currently implemeting a visitor pattern on something like an AST. Now my question is, how do I iterate through the elements ? I think its somewhat more logical to...
Broadbent asked 18/11, 2013 at 9:41

© 2022 - 2024 — McMap. All rights reserved.