Mid GoF Patterns

Visitor Interface (IShoppingCartVisitor):?

  • The IShoppingCartVisitor interface defines the operations that can be

performed on the IShoppingCartElement objects. In this case, the visitor defines

Visit(Book book) and Visit(Fruit fruit) methods for different product

types.

public interface IShoppingCartVisitor

void Visit(Book book);

void Visit(Fruit fruit);

Follow:

More from Design Patterns in C#

All questions for this course