<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/messages-before-objects-y2njlkms2" -->

---
title: Messages Before Objects | daily.dev
description: Designing object-oriented systems by starting with messages rather than classes leads to cleaner, more maintainable code. Using a hotel booking platform as a...
canonical: https://daily.dev/posts/messages-before-objects-y2njlkms2
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Messages Before Objects | daily.dev
og:description: Designing object-oriented systems by starting with messages rather than classes leads to cleaner, more maintainable code. Using a hotel booking platform as a...
og:url: https://daily.dev/posts/messages-before-objects-y2njlkms2
og:image: https://api.daily.dev/og/posts/Y2Njlkms2.png
og:image:alt: Messages Before Objects
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Messages Before Objects

**[Ruby Flow](https://daily.dev/sources/rubyflow)** · 13 min read · 0 upvotes · 0 comments

## Summary

Designing object-oriented systems by starting with messages rather than classes leads to cleaner, more maintainable code. Using a hotel booking platform as a running example, the post demonstrates how identifying required messages first causes well-structured classes to emerge naturally. Key topics include using sequence diagrams as a design discovery tool, the 'ask what not how' principle, context independence, the Law of Demeter, and concrete decoupling techniques in Ruby: dependency injection, isolating unavoidable dependencies, keyword arguments, and depending on stable abstractions over volatile concretions.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://develclan.com/messages-before-objects>

## Similar posts on daily.dev

- [Design Patterns, the Ruby Way \(Part 1\): Why Ruby Changes the Conversation](https://daily.dev/posts/design-patterns-the-ruby-way-part-1-why-ruby-changes-the-conversation-fqi9xk7jx) · Ruby Flow · 1 upvotes · 0 comments
- [Top 10 Software Design Patterns in Rails](https://daily.dev/posts/top-10-software-design-patterns-in-rails-bnryscr6i) · RUBYLAND · 0 upvotes · 0 comments
- [Duck Typing and Inheritance in Ruby](https://daily.dev/posts/duck-typing-and-inheritance-in-ruby-q0pcc61at) · Ruby Flow · 0 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#ruby](https://daily.dev/tags/ruby), [#dependency-injection](https://daily.dev/tags/dependency-injection)

[View this post on daily.dev](https://daily.dev/posts/messages-before-objects-y2njlkms2)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Messages Before Objects","url":"https://daily.dev/posts/messages-before-objects-y2njlkms2","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/messages-before-objects-y2njlkms2"},"datePublished":"2026-04-25T23:10:32.766Z","dateModified":"2026-04-25T23:10:56.154Z","description":"Designing object-oriented systems by starting with messages rather than classes leads to cleaner, more maintainable code. Using a hotel booking platform as a...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/44719da147cb90e65d24d2a20ac332fd?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/44719da147cb90e65d24d2a20ac332fd?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Ruby Flow","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ruby Flow","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/a21aaa8bcbbf448193a016895c90a0e1","url":"https://daily.dev/sources/rubyflow"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/messages-before-objects-y2njlkms2","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,ruby,dependency-injection","timeRequired":"PT13M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ruby Flow","item":"https://daily.dev/sources/rubyflow"},{"@type":"ListItem","position":3,"name":"Messages Before Objects"}]}
```

