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
Francisco Díaz
March 10, 2016
Programming
1
89
Setting Boundaries
Presented at ViDIA meetup.
Francisco Díaz
March 10, 2016
Tweet
Share
More Decks by Francisco Díaz
See All by Francisco Díaz
Working effectively at scale
fdiaz
4
250
I hate public speaking. So why do I keep doing it?
fdiaz
0
83
Definiendo límites
fdiaz
1
68
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
98
Move fast and keep your code quality
fdiaz
1
320
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
110
Swift Values
fdiaz
0
71
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
74
Other Decks in Programming
See All in Programming
複数プロダクトの技術改善・クラウド移行に向き合うチームのフレキシブルなペア・モブプログラミングの実践 / Flexible Pair Programming And Mob Programming
honyanya
0
180
ファーストペンギンBot @Qiita Hackathon 2024 予選
dyson_web
0
210
RDBの世界をぬりかえていくモデルグラフDB〜truncus graphによるモデルファースト開発〜
jurabi
0
160
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
570
Kubernetes上でOracle_Databaseの運用を楽にするOraOperatorの紹介
nnaka2992
0
150
Cohesion in Modeling and Design
mploed
3
180
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
1.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
6
240
CSC305 Lecture 01
javiergs
PRO
1
140
色んなオートローダーを覗き見る #phpcon_okinawa
o0h
PRO
5
370
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
220
タイミーにおけるデータの利用シーンと データ基盤の挑戦
marufeuille
4
3.1k
Featured
See All Featured
A Tale of Four Properties
chriscoyier
155
22k
BBQ
matthewcrist
84
9.2k
Building Your Own Lightsaber
phodgson
102
6k
Clear Off the Table
cherdarchuk
91
320k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
30
2.6k
The Pragmatic Product Professional
lauravandoore
31
6.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.9k
Designing the Hi-DPI Web
ddemaree
279
34k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
6
240
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Code Reviewing Like a Champion
maltzj
519
39k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
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