visitor pattern and violation of encapsulation
void accept(CarElementVisitor *visitor) {
visitor->visit(this);
}
}
Here we are passing an object to a function which adds an operation to
it.Here, it violates encapsulation. Is it good object oriented design ?
No comments:
Post a Comment