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
Setting Boundaries
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Francisco Díaz
March 10, 2016
Programming
180
1
Share
Setting Boundaries
Presented at ViDIA meetup.
Francisco Díaz
March 10, 2016
More Decks by Francisco Díaz
See All by Francisco Díaz
Inteligencia Artificial en PedidosYa - Una mirada pragmática
fdiaz
0
26
Working effectively at scale
fdiaz
4
310
I hate public speaking. So why do I keep doing it?
fdiaz
0
160
Definiendo límites
fdiaz
1
150
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
170
Move fast and keep your code quality
fdiaz
1
410
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
170
Swift Values
fdiaz
0
160
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
150
Other Decks in Programming
See All in Programming
レガシーPHP転生 〜父がドメインエキスパートだったのでDDD+Claude Codeでチート開発します〜
panda_program
0
990
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
0
290
Angular Signal Forms
debug_mode
0
110
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
250
Making the RBS Parser Faster
soutaro
0
410
tRPCの概要と少しだけパフォーマンス
misoton665
2
210
PDI: Como Alavancar Sua Carreira e Seu Negócio
marcelgsantos
0
120
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
4
3k
ドメインイベントでビジネスロジックを解きほぐす #phpcon_odawara
kajitack
3
790
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
150
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
600
Featured
See All Featured
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
HDC tutorial
michielstock
2
630
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
730
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
450
The untapped power of vector embeddings
frankvandijk
2
1.7k
Navigating Weather and Climate Data
rabernat
0
170
Abbi's Birthday
coloredviolet
2
7.1k
Automating Front-end Workflow
addyosmani
1370
200k
Transcript
Setting Boundaries
None
Francisco Díaz @fco_diaz
3 iOS Devs 28 hours 1 project == Merge Conflicts
What do we want? → Minimize duplication of code. →
Develop independently without stepping on each other's toes.
Feature verticals: → Big Panic button → Today widget →
Knock
Big Panic button:
What needs to be done? → Create the button. →
We need a way to create reports. → Make a backend call to save this information.
Today widget:
What needs to be done? → Create the extension button.
→ We need a way to create reports. → Make a backend call to save this information.
What was it that we wanted? → Minimize duplication of
code. → Develop independently without stepping on each other's toes.
None
Let's try again!
→ Create the button. → We need a way to
create reports. → Make a backend call to save this information.
UI / Presentation Create the button.
Business logic We need a way to create reports.
Backend connection Make a backend call to save this information.
None
To recap: → Minimize duplication of code. → Develop independently
without stepping on each other's toes.
We can solve any problem by introducing an extra level
of indirection — David Wheeler
Dependency inversion
struct ModelDataManager { let APIClient: APIType init(APIClient: APIType) { self.APIClient
= APIClient } }
protocol APIType { func createReport(completion: JSONDictionary? -> Void) } struct
API { private let manager: Alamofire.Manager init() { manager = Alamofire.Manager() } } extension API: APIType { func createReport(completion: JSONDictionary? -> Void) { manager.request(.POST, "https://some.com/api/report") .responseJSON { response in completion(response) } } }
struct ModelDataManager { let APIClient: APIType init(API: APIType) { self.APIClient
= API } static func defaultManager() -> ModelDataManager { let APIClient = API() return ModelDataManager(API: APIClient) } func createReport(completionHandler completion: Report? -> Void) { APIClient.createReport() { jsonDictionary in let report = ... // Parse jsonDictionary into Report completion(report) } } }
Benefits → Testable. → Decoupled. → Easy to fake our
networking layer.
None
struct FakeAPI: APIType { func createReport(completion: JSONDictionary? -> Void) {
let dictionary = ["id": 12345] completion(dictionary) } }
struct ModelDataManager { let APIClient: APIType init(API: APIType) { self.APIClient
= API } static func defaultManager() -> ModelDataManager { // let APIClient = API() let APIClient = FakeAPI() return ModelDataManager(API: APIClient) } }
Questions? Slides are available at: https://github.com/fdiaz/settings-boundaries-talk References: Architecture: The Lost
Years The Clean Architecture