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
86
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
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
250
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
[みん強]AIの価値を最大化するデータ基盤戦略:Self-Service型Data Meshへの転換とAgentic AI Meshに向けた取り組み with Snowflake他
y_matsubara
1
180
基礎から解説!Icebergで紐解くSnowflake×Databricks連携の現在地
cm_yasuhara
0
220
個人最適から組織最適へ — 仕組みで進めるAI推進
rfdnxbro
0
110
AI全盛の今だからこそ、あえてもう一度振り返るAPIの基礎
smt7174
3
160
Pythonでベイズモデリング
soogie
0
170
【新卒研修】ライブデモ + compose.yaml読解_講義資料
dip_tech
PRO
0
130
GitHub Copilot のこれまでとこれから: From Copilot to Collaborative Agents
yuriemori
1
120
Orchestration Development Workshopを半期実施して
lycorptech_jp
PRO
0
330
TypeScriptエンジニアのためのWASMランタイム入門:AssemblyScriptから理解するメモリの実態(ayano)
ayanoyuki
0
110
【禁断】Obsidianの第二の脳に「知の巨人」と呼ばれた師匠の脳をロードしてみた
nagatsu
0
5.6k
checker.tsにチキンレースを仕掛けてみた:型エラー(TS2589)が発生する境界線を求めて
hal_spidernight
1
170
Oracle AI Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
6
1.4k
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Design in an AI World
tapps
1
210
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
370
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
Music & Morning Musume
bryan
47
7.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
120
HDC tutorial
michielstock
2
670
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