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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
CSC307 Lecture 01
javiergs
PRO
0
690
Architectural Extensions
denyspoltorak
0
280
Vibe Coding - AI 驅動的軟體開發
mickyp100
0
170
Package Management Learnings from Homebrew
mikemcquaid
0
220
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
720
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
AI & Enginnering
codelynx
0
110
2026年 エンジニアリング自己学習法
yumechi
0
130
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
460
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
440
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
Game over? The fight for quality and originality in the time of robots
wayneb77
1
110
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
110
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
65
The Cult of Friendly URLs
andyhume
79
6.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Producing Creativity
orderedlist
PRO
348
40k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
110
The Spectacular Lies of Maps
axbom
PRO
1
520
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
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