Behavioral Patterns Flashcards

1
Q

What is a command pattern?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the iterator pattern?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a visitor design pattern?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly