Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Functional Reactive
Programming avec RxSwift
Cocoaheads Strasbourg Mai 2017
Nicolas VERINAUD
Freelance
Formateur
Développeur iOS depuis
2011
Prog. Fonctionnelle (yay
F# !)
Qui suis-je ?
@nverinaud
≠ OOP
Composition > Héritage
Fonctions en paramètre
(closures)
Immuabilité
Functional
Programming
Réagir aux changements d’états
Délégation
Closures
Notifications (😨)
KVO (🤢)
Reactive Programming
Réagir aux changements d’états
Délégation [implicite]
Closures [implicite]
Notifications (😨) [implicite]
KVO (🤢) [implicit...
“Explicit is better than implicit.”
–The Zen of Python
Observable<T>
Une valeur qui change
au cours du temps.
Observable<T>
Push
≠
Pull (Sequence)
Observable<T>
protocol Observable<T>
{
func subscribe(_ observer: Observer<T>)
-> Disposable
}
Observable<T>
protocol Observer<T>
{
func onNext(_ element: T)
func onError(_ error: Error)
func onCompleted()
}
Observable<T>
Observable<A> -> Observable<B>
Observable<String> -> Observable<Bool>
Observable<T>
How ?
Observable<A> -> Observable<B>
Observable<String> -> Observable<Bool>
Observable<T>
Avec map !
Monad in disguise…psshh
Observable<A> -> Observable<B>
Observable<String> -> Observable<Bool>
Observable<T>
func map(_ transform: (A -> B)) ->
Obs...
Observable<T>
// strings: Observable<String>
let isEmpty = strings.map { $0.isEmpty }
Observable<T>
Demo !
RxSwift
ou
ReactiveCocoa
?
RxSwift
👍 Respectueux des interfaces Rx
originales
👎 Pas de typage pour Error
ReactiveCocoa
👍 Typage de Error
👍 Distinction Hot et Cold
👎 Concepts ≠ Rx (Signal)
One more thing…
“No Silver Bullet”
–Fred Brooks
“Reactive is dead, long
live tasteful composition
of side effects.”
–Erik Meijer
One Many
Sync T Sequence
Async Future<T> Observable<T>
Tasteful Side Effects
Tasteful Side Effects
Future<Option<Array<String>>>
Result<Observable<String>>
etc…
Tasteful Side Effects
Future<Option<Array<String>>>
Result<Observable<String>>
etc…
Soyez explicites !
Aller plus loin…
ReactiveX.io
IntroToRx.com
React 2014 : Erik Meijer - What
does it mean to be Reactive?
Merci !
@nverinaud
n.verinaud@gmail.com
nverinaud.com
Bibliographie
Kaa - http://www.abadinte.com/wp-content/
uploads/2014/09/Kaa-aie-confiance.jpg
Fred Brooks Wikipedia - http...
Functional Reactive Programming avec RxSwift
Functional Reactive Programming avec RxSwift
Functional Reactive Programming avec RxSwift
Prochain SlideShare
Chargement dans…5
×

Functional Reactive Programming avec RxSwift

1 111 vues

Publié le

Slides de ma conférence donnée à Cocoaheads Strasbourg en mai 2017 sur la programmation fonctionnelle réactive en swift (avec la librairie RxSwift).

Retrouvez le code de la démo ici: https://github.com/nverinaud/prez-frp-cocoaheads-may-2017

Publié dans : Technologie
  • DOWNLOAD THAT BOOKS/FILE INTO AVAILABLE FORMAT - (Unlimited) ......................................................................................................................... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes Christian, Classics, Comics, Contemporary, Cookbooks, Art, Biography, Business, Chick Lit, Children's, Manga, Memoir, Music, Science, Science Fiction, Self Help, History, Horror, Humor And Comedy, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance,
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THAT BOOKS/FILE INTO AVAILABLE FORMAT - (Unlimited) ......................................................................................................................... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes Christian, Classics, Comics, Contemporary, Cookbooks, Art, Biography, Business, Chick Lit, Children's, Manga, Memoir, Music, Science, Science Fiction, Self Help, History, Horror, Humor And Comedy, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance,
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/yyxo9sk7 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download Full EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... Download doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Répondre 
    Voulez-vous vraiment ?  Oui  Non
    Votre message apparaîtra ici

Functional Reactive Programming avec RxSwift

  1. 1. Functional Reactive Programming avec RxSwift Cocoaheads Strasbourg Mai 2017 Nicolas VERINAUD
  2. 2. Freelance Formateur Développeur iOS depuis 2011 Prog. Fonctionnelle (yay F# !) Qui suis-je ? @nverinaud
  3. 3. ≠ OOP Composition > Héritage Fonctions en paramètre (closures) Immuabilité Functional Programming
  4. 4. Réagir aux changements d’états Délégation Closures Notifications (😨) KVO (🤢) Reactive Programming
  5. 5. Réagir aux changements d’états Délégation [implicite] Closures [implicite] Notifications (😨) [implicite] KVO (🤢) [implicite] Reactive Programming
  6. 6. “Explicit is better than implicit.” –The Zen of Python
  7. 7. Observable<T>
  8. 8. Une valeur qui change au cours du temps. Observable<T>
  9. 9. Push ≠ Pull (Sequence) Observable<T>
  10. 10. protocol Observable<T> { func subscribe(_ observer: Observer<T>) -> Disposable } Observable<T>
  11. 11. protocol Observer<T> { func onNext(_ element: T) func onError(_ error: Error) func onCompleted() } Observable<T>
  12. 12. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> How ?
  13. 13. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> Avec map ! Monad in disguise…psshh
  14. 14. Observable<A> -> Observable<B> Observable<String> -> Observable<Bool> Observable<T> func map(_ transform: (A -> B)) -> Observable<B>
  15. 15. Observable<T> // strings: Observable<String> let isEmpty = strings.map { $0.isEmpty }
  16. 16. Observable<T> Demo !
  17. 17. RxSwift ou ReactiveCocoa ?
  18. 18. RxSwift 👍 Respectueux des interfaces Rx originales 👎 Pas de typage pour Error
  19. 19. ReactiveCocoa 👍 Typage de Error 👍 Distinction Hot et Cold 👎 Concepts ≠ Rx (Signal)
  20. 20. One more thing…
  21. 21. “No Silver Bullet” –Fred Brooks
  22. 22. “Reactive is dead, long live tasteful composition of side effects.” –Erik Meijer
  23. 23. One Many Sync T Sequence Async Future<T> Observable<T> Tasteful Side Effects
  24. 24. Tasteful Side Effects Future<Option<Array<String>>> Result<Observable<String>> etc…
  25. 25. Tasteful Side Effects Future<Option<Array<String>>> Result<Observable<String>> etc… Soyez explicites !
  26. 26. Aller plus loin… ReactiveX.io IntroToRx.com React 2014 : Erik Meijer - What does it mean to be Reactive?
  27. 27. Merci ! @nverinaud n.verinaud@gmail.com nverinaud.com
  28. 28. Bibliographie Kaa - http://www.abadinte.com/wp-content/ uploads/2014/09/Kaa-aie-confiance.jpg Fred Brooks Wikipedia - https:// fr.m.wikipedia.org/wiki/Frederick_Brooks Erik Meijer Wikipedia - https://en.wikipedia.org/ wiki/Erik_Meijer_%28computer_scientist%29 React 2014 : Erik Meijer - What does it mean to be Reactive? Meme Generator - memegenerator.net

×