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
100
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
260
I hate public speaking. So why do I keep doing it?
fdiaz
0
90
Definiendo límites
fdiaz
1
75
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
100
Move fast and keep your code quality
fdiaz
1
330
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
110
Swift Values
fdiaz
0
81
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
79
Other Decks in Programming
See All in Programming
Security_for_introducing_eBPF
kentatada
0
110
From Translations to Multi Dimension Entities
alexanderschranz
2
130
14 Years of iOS: Lessons and Key Points
seyfoyun
1
770
return文におけるstd::moveについて
onihusube
1
730
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
240
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
190
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
あれやってみてー駆動から成長を加速させる / areyattemite-driven
nashiusagi
1
200
CSC305 Lecture 25
javiergs
PRO
0
130
Haze - Real time background blurring
chrisbanes
1
500
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
22
1.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
A designer walks into a library…
pauljervisheath
204
24k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Side Projects
sachag
452
42k
Faster Mobile Websites
deanohume
305
30k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.3k
Agile that works and the tools we love
rasmusluckow
328
21k
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