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
QA/SDETの現在と、これからの挑戦
imtnd
0
130
日経電子版 for Android の技術的課題と取り組み(令和最新版)/android-20250423
nikkei_engineer_recruiting
0
410
MCPを活用した検索システムの作り方/How to implement search systems with MCP #catalks
quiver
12
6.7k
LangfuseでAIエージェントの 可観測性を高めよう!/Enhancing AI Agent Observability with Langfuse!
jnymyk
1
240
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
120
AI Agentを「期待通り」に動かすために:設計アプローチの模索と現在地
kworkdev
PRO
2
460
フロントエンドも盛り上げたい!フロントエンドCBとAmplifyの軌跡
mkdev10
2
280
React ABC Questions
hirotomoyamada
0
480
Amazon CloudWatch を使って NW 監視を行うには
o11yfes2023
0
170
ソフトウェア開発現代史: "LeanとDevOpsの科学"の「科学」とは何か? - DORA Report 10年の変遷を追って - #DevOpsDaysTokyo
takabow
0
390
Dynamic Reteaming And Self Organization
miholovesq
3
550
生成AIによるCloud Native基盤構築の可能性と実践的ガードレールの敷設について
nwiizo
7
970
Featured
See All Featured
Building Applications with DynamoDB
mza
94
6.3k
Designing for humans not robots
tammielis
252
25k
Practical Orchestrator
shlominoach
186
11k
Java REST API Framework Comparison - PWX 2021
mraible
30
8.5k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Speed Design
sergeychernyshev
29
900
Git: the NoSQL Database
bkeepers
PRO
430
65k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.1k
Rebuilding a faster, lazier Slack
samanthasiow
80
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