Skip to content

Latest commit

 

History

History
13 lines (8 loc) · 609 Bytes

README.md

File metadata and controls

13 lines (8 loc) · 609 Bytes

Ruby Design Patterns

Template Method

Identifies the framework of an algorithm, allowing implementing classes to define the actual behavior.

Strategy

Identifies a set of encapsulated algorithms that can be swapped to carry out a specific behavior.

Note: With the Template Method pattern, we make our decision when we pick our concrete subclass. In the Strategy pattern, we make our decision by selecting a strategy class at runtime.

Command

This pattern separates out something that changes—the thing that we want to happen when the button is pushed—from something that does not change.