Solution (source code)

= Solution

The classifications and typical uses are

|| Pattern
|| Category
|| When to use it

| <Command pattern>
| <Behavioral design pattern>
| Represent a request as an object, separating its invocation from the receiver. Commands can be queued or logged; undo additionally needs enough information to reverse the particular request.

| <Strategy pattern>
| <Behavioral design pattern>
| Select among interchangeable algorithms through a common interface, such as different routing or scoring policies.

| <Adapter pattern>
| <Structural design pattern>
| Wrap an existing component so clients can use it through a different required interface without changing that component.

| <State pattern>
| <Behavioral design pattern>
| Delegate behavior to an object representing the current state, with transitions selecting another state object instead of scattering conditionals across operations.

| <Visitor pattern>
| <Behavioral design pattern>
| Add operations across a relatively stable element-class hierarchy, commonly through <double dispatch>. Adding a new element type then usually requires updating the visitors.