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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Patrick Robertson
September 20, 2012
Technology
88
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
210
Building Extractable Libraries in Rail - Railsconf
patricksroberts
8
610
Five Gems - BostonRB lightning talk
patricksroberts
2
470
Building Extractable Libraries in Rails - BostonRB
patricksroberts
1
280
This Month in Ruby - December 2012
patricksroberts
0
220
BostonRB Intro - November 2012
patricksroberts
0
260
Building Extractable Libraries in Rails - DCRUG
patricksroberts
2
210
Building Extractable Libraries in Rails
patricksroberts
15
1.8k
Hitch - BostonRB Lighting talk
patricksroberts
1
140
Other Decks in Technology
See All in Technology
インシデント事例と パッケージの全量解析に学ぶ ソフトウェアサプライチェーンの守り方 / supply-chain-attack-defense
flatt_security
0
1.1k
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
1
300
Power Automateアップデート情報
miyakemito
0
250
Webの技術とガジェットで子どもも大人も楽しめるワクワク体験を提供する / Qiita Tech Festa Day 2026
you
PRO
1
290
QA・ソフトウェアテスト研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
460
「休む」重要さ
smt7174
6
1.7k
それでも、技術なブログを書く理由 #kichijojipm / Why I Still Write Tech Blogs Even Now
shinkufencer
0
900
WEBフロントエンド研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
1
280
AIで楽になるはずが、なぜ疲れる?
kinopeee
0
100
CTOキーノート:AI時代の「つなぐ」を再定義 ― 真のIoTとリアルワールドAI【SORACOM Discovery 2026】
soracom
PRO
0
120
ソフトウェアアーキテクチャ研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
470
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
290
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
520
Ruling the World: When Life Gets Gamed
codingconduct
0
290
Producing Creativity
orderedlist
PRO
348
40k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Google's AI Overviews - The New Search
badams
0
1.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
30 Presentation Tips
portentint
PRO
1
350
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
620
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
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