Skip to content

kalelc/ruby-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.