Behavioral Patterns Flashcards
What is a command pattern?
Is a pattern that defines an interface to execute and unexecute commands. Commands can be executed within the command or be delegated. Useful to have command history.
What is the iterator pattern?
Allows iterating over a list of objects, ascending or descending and even other flavors of traversing. It often encapsulates the actual list so that callers won’t be able to modify the list.
What is a visitor design pattern?
Is a design pattern that allows inject a visitant class inside a “visitee”. Therefore, each type of visitor can do a specific action in the “visitee” class itself. All “visitee” shall implement an Accept method. Also the “visitee” class shall expose it’s internal information somehow to the visitor. Visitee is passed via parameter in the visit method.