Patterns

From sheep
Jump to navigation Jump to search

Strategy Pattern

Where algorithms are chosen at runtime

Strategy.png

Visitor Pattern

Separate algorithm from structure

Allows adding new methods to existing structure

Limitation:

  • concrete visitor tied to what concrete elements exist
  • adding a new concrete element => modifying all visitor algorithms & creating new concrete visitor

Visitor.png