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
68
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
450
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
250
This Month in Ruby - December 2012
patricksroberts
0
200
BostonRB Intro - November 2012
patricksroberts
0
230
Building Extractable Libraries in Rails - DCRUG
patricksroberts
2
190
Building Extractable Libraries in Rails
patricksroberts
15
1.8k
Hitch - BostonRB Lighting talk
patricksroberts
1
130
Other Decks in Technology
See All in Technology
SaaSプロダクト開発におけるバグの早期検出のためのAcceptance testの取り組み
kworkdev
PRO
0
530
大規模アジャイル開発のリアル!コミュニケーション×進捗管理×高品質
findy_eventslides
0
680
大規模サービスにおける カスケード障害
takumiogawa
3
760
Cline、めっちゃ便利、お金が飛ぶ💸
iwamot
20
19k
React Server Componentは 何を解決し何を解決しないのか / What do React Server Components solve, and what do they not solve?
kaminashi
6
1.3k
Tokyo dbt Meetup #13 dbtと連携するBI製品&機能ざっくり紹介
sagara
0
240
お問い合わせ対応の改善取り組みとその進め方
masartz
1
560
Lightdashの利活用状況 ー導入から2年経った現在地_20250409
hirokiigeta
0
190
AIエージェント開発における「攻めの品質改善」と「守りの品質保証」 / 2024.04.09 GPU UNITE 新年会 2025
smiyawaki0820
0
130
OPENLOGI Company Profile for engineer
hr01
1
23k
AIエージェントの地上戦 〜開発計画と運用実践 / 2025/04/08 Findy W&Bミートアップ #19
smiyawaki0820
17
4.2k
OPENLOGI Company Profile
hr01
0
62k
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Music & Morning Musume
bryan
46
6.4k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
25k
The Pragmatic Product Professional
lauravandoore
33
6.5k
Into the Great Unknown - MozCon
thekraken
36
1.7k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.4k
Optimising Largest Contentful Paint
csswizardry
35
3.2k
Writing Fast Ruby
sferik
628
61k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
How STYLIGHT went responsive
nonsquared
99
5.4k
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