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
64
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
570
Five Gems - BostonRB lightning talk
patricksroberts
2
410
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
210
This Month in Ruby - December 2012
patricksroberts
0
160
BostonRB Intro - November 2012
patricksroberts
0
190
Building Extractable Libraries in Rails - DCRUG
patricksroberts
2
180
Building Extractable Libraries in Rails
patricksroberts
15
1.8k
Hitch - BostonRB Lighting talk
patricksroberts
1
120
Other Decks in Technology
See All in Technology
Cypress or Playwright?
rainerhahnekamp
0
110
本当のAWS基礎
toru_kubota
0
530
Delivering Millions of Messages within seconds @ Duolingo
pelelgrino
0
350
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.7k
ChatworkのSRE部って実は 半分くらいPlatform Engineering部かもしれない
saramune
0
160
Cloud Native Java with Spring Boot (CNCF Aarhus, April 2024)
thomasvitale
1
180
Python と Snowflake はズッ友だょ!~ Snowflake の Python 関連機能をふりかえる ~
__allllllllez__
1
120
よく聞くけど使ったことないソフトウェアNo.1 KafkaとSnowflake
foursue
4
360
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.6k
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
310
ServiceNow Knowledge Learning Rise up
manarobot
0
210
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
300
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
40
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Web development in the modern age
philhawksworth
202
10k
Fantastic passwords and where to find them - at NoRuKo
philnash
37
2.5k
Gamification - CAS2011
davidbonilla
76
4.6k
Statistics for Hackers
jakevdp
789
220k
A Tale of Four Properties
chriscoyier
151
22k
Web Components: a chance to create the future
zenorocha
305
41k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Building Better People: How to give real-time feedback that sticks.
wjessup
355
18k
The Language of Interfaces
destraynor
151
23k
Robots, Beer and Maslow
schacon
PRO
155
7.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