13

Click here to load reader

Programmation Orientée Protocole {Cocoaheads Montpellier}

Embed Size (px)

Citation preview

Page 1: Programmation Orientée Protocole {Cocoaheads Montpellier}

INTRODUCTION À LA POP EN SWIFTCOCOAHEADS MONTPELLIER – SESSION SEPTEMBRE 2016

Page 2: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 2

SOMMAIRE

Rappel : POOLa POP : quoi de neuf ?Cas pratique 1 : UIView (Live coding)Cas pratique 2 : Networking (Live coding)

Page 3: Programmation Orientée Protocole {Cocoaheads Montpellier}

LA POO

Page 4: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 4

LA POOL’HÉRITAGE C’EST GÉNIAL

NSObject

UIBarItem

UIBarButtonItem UITabBarItem

UIDocument

UIManagedDocument

UIResponder

UIApplication UIView

Page 5: Programmation Orientée Protocole {Cocoaheads Montpellier}

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)

Page 6: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 6

LA POO

Page 7: Programmation Orientée Protocole {Cocoaheads Montpellier}

LA POP

Page 8: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 8

LA POP

POP = Programmation orienté protocol

Page 9: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 9

LA POP

“Instead of using a class, start with a protocol”

— Dave Abrahams: Professor of Blowing Your Mind

Page 10: Programmation Orientée Protocole {Cocoaheads Montpellier}

CAS PRATIQUE 1LIVE CODING : UIVIEW

Page 11: Programmation Orientée Protocole {Cocoaheads Montpellier}

CAS PRATIQUE 2NETWORKING

Page 13: Programmation Orientée Protocole {Cocoaheads Montpellier}

1 MAI 2023 BACKELITE 13

[email protected]

www.backelite.com

CONTACTEZ-NOUSYANG DavidDeveloppeur / Tech Lead iOS