Phase 1 of Ruby on Rails Mastery: six to eight weeks on object-oriented design in Ruby.
Primary book: Practical Object-Oriented Design in Ruby (POODR) by Sandi Metz
Supplementary: Design Patterns in Ruby by Russ Olsen
Weekly focus
| Week | Topic | Practice |
|---|---|---|
| 1 | OO design, single responsibility | Extract classes from a messy script |
| 2 | Managing dependencies | Inject dependencies instead of hard-coding |
| 3 | Flexible interfaces | Define a public API for a small library |
| 4 | Duck typing | Replace case/when with duck typing |
| 5 | Inheritance | Refactor a template method pattern |
| 6 | Roles via modules | Use include/extend for roles |
| 7 | Composing objects | Build a board game using all principles |
Milestone
Re-implement a board game (chess or checkers) in pure Ruby with POODR principles.
Mini-projects
Seven ~20-minute API exercises in the repo, from a CEP lookup service to a GitHub repo stats client. Each one is designed to hide an API behind well-designed objects.
Posts in this series document concepts, code, and patterns as I work through the phase.
