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
120
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
280
I hate public speaking. So why do I keep doing it?
fdiaz
0
120
Definiendo límites
fdiaz
1
96
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
120
Move fast and keep your code quality
fdiaz
1
350
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
120
Swift Values
fdiaz
0
100
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
99
Other Decks in Programming
See All in Programming
Unlock the Potential of Swift Code Generation
rockname
0
250
PHPバージョンアップから始めるOSSコントリビュート / how2oss-contribute
dmnlk
1
1.1k
エンジニア未経験が最短で戦力になるためのTips
gokana
0
280
サービスクラスのありがたみを発見したときの思い出 #phpcon_odawara
77web
4
670
Exit 8 for SwiftUI
ojun9
0
130
Chrome Extension Techniques from Hell
moznion
1
160
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
750
Agentic Applications with Symfony
el_stoffel
2
300
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
0
140
DataStoreをテストする
mkeeda
0
290
小田原でみんなで一句詠みたいな #phpcon_odawara
stefafafan
0
340
RuboCop: Modularity and AST Insights
koic
2
810
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.8k
Side Projects
sachag
452
42k
StorybookのUI Testing Handbookを読んだ
zakiyama
29
5.6k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.4k
Facilitating Awesome Meetings
lara
54
6.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Being A Developer After 40
akosma
91
590k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
Agile that works and the tools we love
rasmusluckow
328
21k
Music & Morning Musume
bryan
47
6.5k
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