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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Patrick Robertson
September 20, 2012
Technology
83
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
200
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
140
Other Decks in Technology
See All in Technology
Claude Code を安全に使おう勉強会 / Claude Code Security Basics
masahirokawahara
12
38k
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
400
AIコーディング時代における、ソフトウェアサプライチェーン攻撃に対する防衛術(簡易版)
soysoysoyb
0
160
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
1.8k
Scovilleモバイルエンジニア募集中.pdf
julienrudin
0
120
PicoRuby as a Multi-VM Operating System
kishima
1
220
Rapid Start: Faster Internet Connections, with Ruby's Help
kazuho
2
820
[OpsJAWS 40]リリースしたら終わり、じゃなかった。セキュリティ空白期間をAWS Security Agentで埋める
sh_fk2
3
260
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.4k
独断と偏見で試してみる、 シングル or マルチエージェント どっちがいいの?
shichijoyuhi
1
160
社内エンジニア勉強会の醍醐味と苦しみ/tamadev
nishiuma
0
250
Route 53 Global Resolver で高額課金発生!
otanikohei2023
0
130
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
270
From π to Pie charts
rasagy
0
170
Agile that works and the tools we love
rasmusluckow
331
21k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Leo the Paperboy
mayatellez
7
1.7k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
55k
Designing for humans not robots
tammielis
254
26k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
54k
How to train your dragon (web standard)
notwaldorf
97
6.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