Mid From PDF GoF Patterns Gang of Four 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);

}

More from Design Patterns in C#

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details