This is code for a talk I gave for Springs.rb.
Heavily influenced by:
Design Patterns Elements of Reusabled Object-Oriented Software By: Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides
Design patterns are used as solutions to common problems within OO programming. They have four parts:
- Pattern name
- Problem
- Solution
- Consequences
There are fundamentally three groupings of patterns:
- Creational Patterns - deal with object creation
- Structural Patterns - composition of classes or objects
- Behavioral Patterns - how classes or objects interact and distribute responsibilities
I wanted to give code examples for each. But truthfully, code is the least important part of a DP. Understanding what it is and why you are using it is more important. So while I'll try to cover some of that in the readme, the book is much better at it than I am.
I'm going to cover 4 of the 23 + 2 more:
- Builder
- Singleton
- Decorator
- Observer
- Delegation
- Concerns
- Design Patterns in Ruby
- Cute or Ugly - Reminder to be smart about using Design Patterns