Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Setting Boundaries
Francisco Díaz
March 10, 2016
Programming
1
54
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
200
I hate public speaking. So why do I keep doing it?
fdiaz
0
42
Definiendo límites
fdiaz
1
30
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
59
Move fast and keep your code quality
fdiaz
1
260
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
44
Swift Values
fdiaz
0
36
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
45
Other Decks in Programming
See All in Programming
Java初心者が知っておくべきプログラミングのこと - JJUG CCC 2022 Spring
kishida
5
550
From Java through Scala to Clojure
lagenorhynque
0
220
I/O Extended 2022 in Android ~ Whats new in Android development tools
pluu
0
560
ES2022の新機能
smt7174
0
250
Amazon ECSのネットワーク関連コストの話
msato
0
640
iOS 16からのロック画面Widget争奪戦に備える
tsuzuki817
0
230
Meet Swift Regex
usamik26
0
350
Jetpack Composeでの画面遷移
iwata_n
0
170
Scrum Fest Osaka 2022/5年で200人になったスタートアップの アジャイル開発の歴史とリアル
atamaplus
1
890
Get Ready for Jakarta EE 10
ivargrimstad
0
490
engineer
spacemarket
0
1.3k
模組化的Swift架構(二) DDD速成
haifengkao
0
390
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
780
250k
Six Lessons from altMBA
skipperchong
14
1.4k
YesSQL, Process and Tooling at Scale
rocio
157
12k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
269
11k
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
5
2.2k
The Pragmatic Product Professional
lauravandoore
19
3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
315
19k
Visualization
eitanlees
125
11k
Designing with Data
zakiwarfel
91
3.9k
5 minutes of I Can Smell Your CMS
philhawksworth
196
18k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
224
49k
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