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
0
65
DCI Like a BOSS - BostonRB lightning talk
quick talk on DCI for BostonRB lightning talk night.
Patrick Robertson
September 20, 2012
Tweet
Share
More Decks by Patrick Robertson
See All by Patrick Robertson
CORS + EmberJS
patricksroberts
0
180
Building Extractable Libraries in Rail - Railsconf
patricksroberts
8
580
Five Gems - BostonRB lightning talk
patricksroberts
2
430
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
230
This Month in Ruby - December 2012
patricksroberts
0
180
BostonRB Intro - November 2012
patricksroberts
0
210
Building Extractable Libraries in Rails - DCRUG
patricksroberts
2
190
Building Extractable Libraries in Rails
patricksroberts
15
1.8k
Hitch - BostonRB Lighting talk
patricksroberts
1
120
Other Decks in Technology
See All in Technology
TypeScript、上達の瞬間
sadnessojisan
48
14k
LINEヤフーにおけるPrerender技術の導入とその効果
narirou
1
160
『Firebase Dynamic Links終了に備える』 FlutterアプリでのAdjust導入とDeeplink最適化
techiro
0
170
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
強いチームと開発生産性
onk
PRO
36
12k
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
Terraform Stacks入門 #HashiTalks
msato
0
360
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
310
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
110
【LT】ソフトウェア産業は進化しているのか? #Agilejapan
takabow
0
100
DynamoDB でスロットリングが発生したとき/when_throttling_occurs_in_dynamodb_short
emiki
0
270
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Designing Experiences People Love
moore
138
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Scaling GitHub
holman
458
140k
How STYLIGHT went responsive
nonsquared
95
5.2k
Speed Design
sergeychernyshev
25
620
Into the Great Unknown - MozCon
thekraken
32
1.5k
GraphQLとの向き合い方2022年版
quramy
43
13k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Why Our Code Smells
bkeepers
PRO
334
57k
Happy Clients
brianwarren
98
6.7k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
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