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);
}Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png