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
Fabio Kuhn
January 31, 2012
Programming
230
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
AWS DevOps AgentのAzure接続機能を検証して見えた活用法/Use Cases Verified for the AWS DevOps Agent's Azure Connectivity Feature
masakiokuda
1
250
Claude Code全社展開のためにやったことn選~プラグイン302個・コミッター271人を支えるために~
kenchan
5
1.6k
メールのエイリアス機能を履き違えない
isshinfunada
0
250
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.9k
そこに3びきプロダクトがいるじゃろう——生成AI時代における“価値が届かない理由”の構造
kosuket
0
520
仕様駆動開発へのトライを機に チームに適合する手法を模索し続けている話
freee
PRO
0
580
jsmini JavaScript Engine を作ってみた話
yosuke_furukawa
PRO
0
340
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.9k
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
1
710
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
190
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
210
Featured
See All Featured
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
220
How to train your dragon (web standard)
notwaldorf
97
6.8k
Music & Morning Musume
bryan
47
7.3k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
Producing Creativity
orderedlist
PRO
348
40k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
250
Side Projects
sachag
455
43k
A designer walks into a library…
pauljervisheath
211
24k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
650
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
Become a Pro
speakerdeck
PRO
31
6.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