Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Setting Boundaries
Search
Francisco Díaz
March 10, 2016
Programming
220
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
62
Working effectively at scale
fdiaz
4
340
I hate public speaking. So why do I keep doing it?
fdiaz
0
180
Definiendo límites
fdiaz
1
170
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
200
Move fast and keep your code quality
fdiaz
1
450
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
190
Swift Values
fdiaz
0
190
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
180
Other Decks in Programming
See All in Programming
速習iPhone Duo対応
yuukiw00w
2
960
残高管理から台帳サービスへの進化
artoy
0
170
プロダクトコードからライブラリの境界を見つける
elmetal
PRO
0
110
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
450
The Rails Doctrine Decade
koic
2
510
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
120
Security issues being discussed on Web Platforms
petamoriken
0
1.4k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
140
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
350
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
300
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
630
難しいけど、読めた。- OSSの入口に立った話。
sts11142
0
140
Featured
See All Featured
For a Future-Friendly Web
brad_frost
184
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
KATA
mclloyd
PRO
35
16k
Chasing Engaging Ingredients in Design
codingconduct
0
340
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
350
sira's awesome portfolio website redesign presentation
elsirapls
0
440
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
510
How to build a perfect <img>
jonoalderson
1
6.1k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
320
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
550
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