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
200
Other Decks in Programming
See All in Programming
Java 21/25 Virtual Threads 소개
debop
0
320
Vibe하게 만드는 Flutter GenUI App With ADK , 박제창, BWAI Incheon 2026
itsmedreamwalker
0
540
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
230
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
180
飯MCP
yusukebe
0
480
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
380
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
モダンOBSプラグイン開発
umireon
0
200
20260320登壇資料
pharct
0
160
Smarter Angular mit Transformers.js & Prompt API
christianliebel
PRO
1
120
感情を設計する
ichimichi
5
970
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
170
Featured
See All Featured
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.6k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
53k
Paper Plane
katiecoart
PRO
1
49k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
280
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
Odyssey Design
rkendrick25
PRO
2
560
Visualization
eitanlees
150
17k
So, you think you're a good person
axbom
PRO
2
2k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
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