Programmation Orientée Protocole {Cocoaheads Montpellier}

Post on 07-Feb-2017

116 Views

Category:

Technology

8 Downloads

Preview:

Click to see full reader

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 13

david.yang@backelite.com

www.backelite.com

CONTACTEZ-NOUSYANG DavidDeveloppeur / Tech Lead iOS

top related