Copied
Please follow the site license
LMafra // LMafra's Blog
Be Curious, Not Judgmental

Object-Oriented Design

Be Curious, Not Judgmental

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#

WeekTopicPractice
1OO design, single responsibilityExtract classes from a messy script
2Managing dependenciesInject dependencies instead of hard-coding
3Flexible interfacesDefine a public API for a small library
4Duck typingReplace case/when with duck typing
5InheritanceRefactor a template method pattern
6Roles via modulesUse include/extend for roles
7Composing objectsBuild 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.

Subject_Dossier
RP
Rhine Lab Spec Division
Dossier_Verified06
© 2026 LMafra's Blog
Powered by Astro & Lonetrail