Skip to main content
replaced http://softwareengineering.stackexchange.com/ with https://softwareengineering.stackexchange.com/
Source Link

In my opinion, it is consistent. You are just implementing stateful visitor. Take a look at my answermy answer to this questionquestion. There are some similarities here with the way you are implementing visitor, in terms of initializing visitor first, and then invoking other methods of that visitor.

The only thing that might be somewhat inconsistent with visitor pattern is the bindData method. In my opinion, this is unnecessary here. You already have object->setName method. Use that method, and just expose data field for reading in SimpleVisitor class.

In my opinion, it is consistent. You are just implementing stateful visitor. Take a look at my answer to this question. There are some similarities here with the way you are implementing visitor, in terms of initializing visitor first, and then invoking other methods of that visitor.

The only thing that might be somewhat inconsistent with visitor pattern is the bindData method. In my opinion, this is unnecessary here. You already have object->setName method. Use that method, and just expose data field for reading in SimpleVisitor class.

In my opinion, it is consistent. You are just implementing stateful visitor. Take a look at my answer to this question. There are some similarities here with the way you are implementing visitor, in terms of initializing visitor first, and then invoking other methods of that visitor.

The only thing that might be somewhat inconsistent with visitor pattern is the bindData method. In my opinion, this is unnecessary here. You already have object->setName method. Use that method, and just expose data field for reading in SimpleVisitor class.

Source Link

In my opinion, it is consistent. You are just implementing stateful visitor. Take a look at my answer to this question. There are some similarities here with the way you are implementing visitor, in terms of initializing visitor first, and then invoking other methods of that visitor.

The only thing that might be somewhat inconsistent with visitor pattern is the bindData method. In my opinion, this is unnecessary here. You already have object->setName method. Use that method, and just expose data field for reading in SimpleVisitor class.