Skip to content

[Module 4] Visitor design pattern - Calculator #38

Description

@xgillard

**This issue relates to #35 ** (should probably be a subtask of it).

This exercise is a wrong use case of the visitor pattern. The appropriate pattern to use here is the Interpreter pattern.
While it is true that one can implement a grammar-like interpretation with a visitor, this is pretty artificial and forces to break encapsulation. (Encapsulation breakage is the major inconvenient of Visitor pattern and built in it).

An exercise about the visitor pattern should start by recalling what double dispatch is and provide an example that requires it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions