Domain Modeling in Ruby

Learn robust and flexible patterns for modeling your business domain in idiomatic Ruby code.

Model. View. Controller. Active Record. If you’re familiar with Ruby you’re probably familiar with the Ruby on Rails web application framework, and if you’ve used Rails you recognize these terms.

What you might not know is that all of these terms in Rails come from a book: Patterns of Enterprise Application Architecture (PoEAA), by Martin Fowler. Ruby on Rails is in many ways a direct transcription of many of the patterns from PoEAA—which had originally been distilled from Java and .NET projects—into the wonderfully flexible and expressive Ruby language.

PoEAA is a book about domain modeling: finding practical ways of reflecting a complex business domain in code. In this course, you’ll learn about many different patterns for domain modeling. As well as some anti-patterns: techniques to avoid, with explanations of why.

Many of the patterns come from PoEAA, and here you’ll see some ground-up implementations of them, with discussions of pros and cons. Others stem from other sources, such as Ward Cunningham’s classic CHECKS Pattern Language paper. Some are patterns for persisting and restoring domain-representative objects to and from database storage. Some are about modeling logic and workflows. Some deal with the question of how to split domain and pragmatic concerns into collaborating objects.

The common factor is that these are all approaches for modeling business domains in software, in a way that remains comprehensible and malleable. Many of them are patterns that your framework already implements for you. But studying them and perhaps re-implementing them will give you a firmer grounding in the tools you use every day… and an idea for where to look when those tools don’t seem to match up to the problem at hand.

Prerequisites: while there is a little bit of overlap, some of the material here builds on topics covered in Master the Object-Oriented Mindset in Ruby and Rails. If you’re still a little shaky on object-oriented concepts, you might want to skim through that course before starting up this one. This course is also part of the Ruby for Graceful App Development garden tour.

This course is a Graceful.Dev Garden Path, meaning it is a suggested pathway through a curated selection of self-contained topics. Its status is mature: new topics may still be added, but it is a fully fleshed-out course of study.

Not Enrolled

Course Includes

  • 7 Modules
  • 40 Topics