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 Like a BOSS - BostonRB lightning talk
Search
Patrick Robertson
September 20, 2012
Technology
80
0
Share
DCI Like a BOSS - BostonRB lightning talk
quick talk on DCI for BostonRB lightning talk night.
Patrick Robertson
September 20, 2012
More Decks by Patrick Robertson
See All by Patrick Robertson
CORS + EmberJS
patricksroberts
0
190
Building Extractable Libraries in Rail - Railsconf
patricksroberts
8
600
Five Gems - BostonRB lightning talk
patricksroberts
2
460
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
280
This Month in Ruby - December 2012
patricksroberts
0
210
BostonRB Intro - November 2012
patricksroberts
0
250
Building Extractable Libraries in Rails - DCRUG
patricksroberts
2
200
Building Extractable Libraries in Rails
patricksroberts
15
1.8k
Hitch - BostonRB Lighting talk
patricksroberts
1
130
Other Decks in Technology
See All in Technology
CREがSLOを握ると 何が変わるのか
nekomaho
0
340
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
260
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
300
AWSで2番目にリリースされたサービスについてお話しします(諸説あります)
yama3133
0
100
JAWS DAYS 2026でAIの「もやっと」感が解消された話
smt7174
1
120
MIX AUDIO EN BROADCAST
ralpherick
0
140
スケーリングを封じられたEC2を救いたい
senseofunity129
0
130
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
18k
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
20260326_AIDD事例紹介_ULSC.pdf
findy_eventslides
0
310
ThetaOS - A Mythical Machine comes Alive
aslander
0
230
Zephyr(RTOS)でARMとRISC-Vのコア間通信をしてみた
iotengineer22
0
120
Featured
See All Featured
Test your architecture with Archunit
thirion
1
2.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
340
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
150
Building Flexible Design Systems
yeseniaperezcruz
330
40k
How to Ace a Technical Interview
jacobian
281
24k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
120
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
500
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
94
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
160
Leo the Paperboy
mayatellez
5
1.6k
Transcript
DCI
Hello There! I’m @patricksroberts. I work at @iorahealth. I co-organize
@bostonrb.
DATA CONTEXT INTERACTION
DCI is a strategy to separate what your system does
from what your system is.
The Old and Busted Way
# app/models/user.rb class User < ActiveRecord::Base validates_presence_of :twitter_handle def tweet
TwitterWrangler.add_to_queue twitter_handle, twitter message end private def twitter_message “Today my BMI is #{body_mass_index} and I’m #{percent_of_body_mass_index_goal} from my goal of #{body_mass_index_goal}!” end end
THE NEW HOTNESS
DATA
# app/models/user.rb class User < ActiveRecord::Base validates_presence_of :twitter_handle end
ROLE
# app/roles/twit_user.rb module TwitUser def twitter_message “Today my BMI is
#{body_mass_index} and I’m #{percent_of_body_mass_index_goal} from my goal of #{body_mass_index_goal}!” end end
CONTEXT
# app/contexts/bmi_update_tweet.rb class BmiUpdateTweet attr_reader :user def initialize(user) @user =
user @user.extend TwitUser end def call TwitterWrangler.add_to_queue @user.twitter_handle, @user.twitter_message end end
INTERACTION
# app/controllers/tweets_controller.rb class TweetsController < ApplicationController def update user =
User.find(params[:id]) BmiUpdateTweet.new(user).call respond_with :ok end end