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
81
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
79
Definiendo límites
fdiaz
1
60
Si odio hablar en público. ¿Por qué lo sigo haciendo?
fdiaz
2
92
Move fast and keep your code quality
fdiaz
1
310
De qué hablo cuando hablo de trabajo remoto
fdiaz
1
100
Swift Values
fdiaz
0
65
Sisifo o Cómo empezar de nuevo - y otra vez.
fdiaz
0
69
Other Decks in Programming
See All in Programming
CSC307 Lecture 06
javiergs
PRO
0
360
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
Jetpack for KMP
fornewid
1
290
開発部に不満を持っていたCSがエンジニアにジョブチェンしてわかった「勝手に諦めない」ことの大切さ
sakuraikotone
28
16k
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
310
最近追加した型の紹介とその振り返り
aki19035vc
0
180
わかりやすい正解を捨てて、コトに向き合う - スクラムフェス金沢2024 スポンサーセッション
yusukekokubo
0
170
しくじり先生 Image Matching Challenge 2024 編
goosehaaan
0
810
Polarsの成長: v0.14からv1.0までの変遷と今後の展望
zerebom
1
350
Advanced App Shrinking Techniques
cbeyls
2
150
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
380
Android開発者のための Kotlin Multiplatform入門
ntaro
0
190
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Making Projects Easy
brettharned
111
5.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
149
45k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
17
8.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
26
1.8k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
A designer walks into a library…
pauljervisheath
201
24k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
12
3.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Stop Working from a Prison Cell
hatefulcrawdad
266
20k
No one is an island. Learnings from fostering a developers community.
thoeni
17
2.8k
Adopting Sorbet at Scale
ufuk
71
8.8k
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