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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Fabio Kuhn
January 31, 2012
Programming
230
1
Share
DCI and Ruby
What is DCI and how can we use it with Ruby?
Fabio Kuhn
January 31, 2012
More Decks by Fabio Kuhn
See All by Fabio Kuhn
RubyMotion
mordaroso
1
210
Other Decks in Programming
See All in Programming
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
400
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
1
1.5k
inferと仲良くなる10分間
ryokatsuse
1
330
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.4k
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1.3k
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
700
自動レビューエンジンの実装と運用 ~レビューのない世界へ~
kurukuru1999
2
310
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
200
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
770
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
540
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.4k
Featured
See All Featured
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
130
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
55k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
240
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
190
KATA
mclloyd
PRO
35
15k
Design in an AI World
tapps
1
220
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
How STYLIGHT went responsive
nonsquared
100
6.2k
Into the Great Unknown - MozCon
thekraken
41
2.5k
GitHub's CSS Performance
jonrohan
1033
470k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
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