programmation orientée protocole {cocoaheads montpellier}
TRANSCRIPT
INTRODUCTION À LA POP EN SWIFTCOCOAHEADS MONTPELLIER – SESSION SEPTEMBRE 2016
1 MAI 2023 BACKELITE 2
SOMMAIRE
Rappel : POOLa POP : quoi de neuf ?Cas pratique 1 : UIView (Live coding)Cas pratique 2 : Networking (Live coding)
LA POO
1 MAI 2023 BACKELITE 4
LA POOL’HÉRITAGE C’EST GÉNIAL
NSObject
UIBarItem
UIBarButtonItem UITabBarItem
UIDocument
UIManagedDocument
UIResponder
UIApplication UIView
1 MAI 2023 BACKELITE 5
LA POOPROBLÈMES
• Faire attention aux états de nos objets (mutable/immutable)• Multi-threading• Les sous-classes : complexité, héritage multiples, etc.• God classes• Les tests unitaires ! (mock, etc)
1 MAI 2023 BACKELITE 6
LA POO
LA POP
1 MAI 2023 BACKELITE 8
LA POP
POP = Programmation orienté protocol
1 MAI 2023 BACKELITE 9
LA POP
“Instead of using a class, start with a protocol”
— Dave Abrahams: Professor of Blowing Your Mind
CAS PRATIQUE 1LIVE CODING : UIVIEW
CAS PRATIQUE 2NETWORKING
1 MAI 2023 BACKELITE 12
LIENS UTILES
https://developer.apple.com/videos/play/wwdc2015/408/
https://realm.io/news/appbuilders-natasha-muraschev-practical-protocol-oriented-programming/
http://krakendev.io/blog/subclassing-can-suck-and-heres-why
1 MAI 2023 BACKELITE 13
www.backelite.com
CONTACTEZ-NOUSYANG DavidDeveloppeur / Tech Lead iOS