Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DCI and Ruby
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Fabio Kuhn
January 31, 2012
Programming
1
230
DCI and Ruby
What is DCI and how can we use it with Ruby?
Fabio Kuhn
January 31, 2012
Tweet
Share
More Decks by Fabio Kuhn
See All by Fabio Kuhn
RubyMotion
mordaroso
1
200
Other Decks in Programming
See All in Programming
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
Patterns of Patterns
denyspoltorak
0
1.4k
Grafana:建立系統全知視角的捷徑
blueswen
0
330
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
450
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
SourceGeneratorのススメ
htkym
0
190
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
MUSUBIXとは
nahisaho
0
130
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Featured
See All Featured
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
It's Worth the Effort
3n
188
29k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
320
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Making Projects Easy
brettharned
120
6.6k
Optimizing for Happiness
mojombo
379
71k
Site-Speed That Sticks
csswizardry
13
1.1k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
Believing is Seeing
oripsolob
1
53
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
GraphQLとの向き合い方2022年版
quramy
50
14k
Transcript
DCI and Ruby
What is DCI? Trygve Reenskaug (MVC, UML) Data, context and
interaction OOP paradigm Goals Improve readability Separation of code System state instead of object state End user style of thinking
None
Theatre Director Actors Scene Roles
Data “What the system is” - Actor Simple object Basic
functionality / no interaction with other objects Object thinking instead of class thinking
Context “How the system looks and starts” - Director Represents
one or more use cases Identify objects and assign them roles at runtime Use case functionality = data objects with assigned roles combined
Interaction “What the system does” - Role Roles played by
objects Stateless call methods on self (= playing object) Interactions are generic
None
Example Waitress Complex Model (my waitress, employee, person in restaurant)
Placing an order CustomerOrdersMeal Object Actors: Customer, Waitress Extend Customer with Consumer and Waitress with MenuCard and OrderManager Call waitress.order_meal(customer, meal)
Conflict or Complementary? Fat Model? MVC / Model2? REST? Ruby?
Rails?
DCI in Rails Data => ActiveRecord Model Context => Controller
action or separate workflow class Roles => Module to mix in
Sources http://en.wikipedia.org/wiki/Data,_Context,_and_Interaction http://andrzejonsoftware.blogspot.com http://nicksda.apotomo.de/2011/12/ruby-on-rest-2- representers-and-the-dci-pattern/ http://mikepackdev.com/blog_posts/24-the-right-way-to- code-dci-in-ruby
Learn more... http://www.leansoftwarearchitecture.com/ http://vimeo.com/8235394