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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Patrick Robertson
September 20, 2012
Technology
0
74
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
190
Building Extractable Libraries in Rail - Railsconf
patricksroberts
8
590
Five Gems - BostonRB lightning talk
patricksroberts
2
460
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
270
This Month in Ruby - December 2012
patricksroberts
0
210
BostonRB Intro - November 2012
patricksroberts
0
240
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
re:Inventで見つけた「運用を捨てる」技術。
ezaki
1
150
最速で価値を出すための プロダクトエンジニアのツッコミ術
kaacun
1
330
AI推進者の視点で見る、Bill OneのAI活用の今
sansantech
PRO
1
200
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
250
「全社導入」は結果。1人の熱狂が組織に伝播したmikanのn8n活用
sota_mikami
0
570
Tebiki Engineering Team Deck
tebiki
0
23k
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
72k
Databricks Free Edition講座 データサイエンス編
taka_aki
0
230
AI開発をスケールさせるデータ中心の仕組みづくり
kzykmyzw
0
180
toCプロダクトにおけるAI機能開発のしくじりと学び / ai-product-failures-and-learnings
rince
5
3.6k
ドメイン駆動セキュリティへの道しるべ
pandayumi
0
180
AIとともに歩む情報セキュリティ / Information Security with AI
kanny
4
2.6k
Featured
See All Featured
Designing for Performance
lara
610
70k
Scaling GitHub
holman
464
140k
Skip the Path - Find Your Career Trail
mkilby
0
50
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
How Software Deployment tools have changed in the past 20 years
geshan
0
31k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
270
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
280
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
420
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Marketing to machines
jonoalderson
1
4.6k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.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