Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
April 2018
www.asiantech.vn
D E V D A Y
2 0 1 8
STUDIED AT DA NANG UNIVERSITY OF
SCIENCE AND TECHNOLOGY
TECHNICAL LEADER AT ASIAN TECH
ME
2
NAME: UNG VĂN THỊNH
PLATFORM: ...
April 2018
www.asiantech.vn
R E A C T I V E
P R O G R A M M I N
G
SLIDE
4
PROGRAMMING PARADIGMS
SLIDE
5
A way to classify programming languages based on their features
Concept
SLIDE
6
IMPERATIVE
PROGRAMMING
Uses statements that change a program's state
Telling the “machine” how to do somet...
Concept
SLIDE
7
DECLARATIVE
PROGRAMMING
Expresses the logic of a computation without describing
its control flow
Describes...
THE RISE OF
DECLARATIVE
PROGRAMMING
SLIDE
8
MINIMIZE MUTABILITY
REDUCE STATE SIDE-EFFECTS
LEAD TO MORE UNDERSTANDABLE
AND ...
REACTIVE PROGRAMMING
SLIDE
9
Reactive
Definition
SLIDE
10
REACTIVE
PROGRAMMING
Reactive programming is programming with asynchronous data streams
Example
SLIDE
11
REACTIVE
PROGRAMMING
STREAM
CENTRAL OF REACTIVE
VARIABLES, USER INPUTS,
PROPERTIES, CACHES, DATA
STRUCTURES, ETC.
OVER TIME
SLIDE
12
Abstractio...
Observable/Observer
SLIDE
13
REACTIVE
PROGRAMMING
Observable
Observer
Observer
onNext()
onError()
onCompleted()
Operator
SLIDE
14
REACTIVE
PROGRAMMING
Transform a stream to other stream
map()
reduce()
filter()
etc.
VS Traditional programming
SLIDE
15
REACTIVE
PROGRAMMING
var a = 1
var b = 2
var c = a + b
print(c)
let a: Variable<Int> =...
ASYNCHRONOUS
SLIDE
16
AdvantageREACTIVE
PROGRAMMING
Thread 1Thread 2Thread 3
Main ThreadobserveOn()
updateView()
ASYNCHRONOUS
SLIDE
17
AdvantageREACTIVE
PROGRAMMING
USER INTERACTION
SLIDE
18
AdvantageREACTIVE
PROGRAMMING
USER INTERACTION
SLIDE
19
AdvantageREACTIVE
PROGRAMMING
EXTENSIBILITY
SLIDE
20
AdvantageREACTIVE
PROGRAMMING
Example:
- Array of Int
- Take 3 first elements
- Less than 10
DATA BINDING
SLIDE
21
AdvantageREACTIVE
PROGRAMMING
SLIDE
22
extensionsREACTIVE
PROGRAMMING
RxJava
RxJS
RxRuby
RxSwift
RxPHP
Etc.
PROGRAMMING TRENDING
SLIDE
23
BENEFIT OF REACTIVE
PROGRAMMING
WHAT IS REACTIVE
PROGRAMMING
EXTENSIONS
ReviewREACTIVE
PROGR...
SLIDE
24
REACTIVE
PROGRAMMING
Are you ready to adopt this programming paradigm?
THANKS!
Any questions?
You can contact me:
Mail: thinh.ung@asiantech.vn
Phone: 097 9476275
25
Upcoming SlideShare
Loading in …5
×

[DevDay2018] Reactive Programming - By Thinh Ung, Technical Leader at Asian Tech

115 views

Published on

In his session, Thinh will conduct a seminar on Relactive Programming – an asynchronous programming paradigm concerned with data streams and the propagation of change.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

[DevDay2018] Reactive Programming - By Thinh Ung, Technical Leader at Asian Tech

  1. 1. April 2018 www.asiantech.vn D E V D A Y 2 0 1 8
  2. 2. STUDIED AT DA NANG UNIVERSITY OF SCIENCE AND TECHNOLOGY TECHNICAL LEADER AT ASIAN TECH ME 2 NAME: UNG VĂN THỊNH PLATFORM: iOS
  3. 3. April 2018 www.asiantech.vn R E A C T I V E P R O G R A M M I N G
  4. 4. SLIDE 4
  5. 5. PROGRAMMING PARADIGMS SLIDE 5 A way to classify programming languages based on their features
  6. 6. Concept SLIDE 6 IMPERATIVE PROGRAMMING Uses statements that change a program's state Telling the “machine” how to do something, and as a result what you want to happen will happen Most widely used paradigm
  7. 7. Concept SLIDE 7 DECLARATIVE PROGRAMMING Expresses the logic of a computation without describing its control flow Describes what you want to do, and not how you want to do it
  8. 8. THE RISE OF DECLARATIVE PROGRAMMING SLIDE 8 MINIMIZE MUTABILITY REDUCE STATE SIDE-EFFECTS LEAD TO MORE UNDERSTANDABLE AND MORE SCALABLE CODE
  9. 9. REACTIVE PROGRAMMING SLIDE 9 Reactive
  10. 10. Definition SLIDE 10 REACTIVE PROGRAMMING Reactive programming is programming with asynchronous data streams
  11. 11. Example SLIDE 11 REACTIVE PROGRAMMING
  12. 12. STREAM CENTRAL OF REACTIVE VARIABLES, USER INPUTS, PROPERTIES, CACHES, DATA STRUCTURES, ETC. OVER TIME SLIDE 12 AbstractionREACTIVE PROGRAMMING
  13. 13. Observable/Observer SLIDE 13 REACTIVE PROGRAMMING Observable Observer Observer onNext() onError() onCompleted()
  14. 14. Operator SLIDE 14 REACTIVE PROGRAMMING Transform a stream to other stream map() reduce() filter() etc.
  15. 15. VS Traditional programming SLIDE 15 REACTIVE PROGRAMMING var a = 1 var b = 2 var c = a + b print(c) let a: Variable<Int> = Variable(1) let b: Variable<Int> = Variable(2) let c = Observable.combineLatest(a, b) c.subscribe { (value) in print(value) } // c = 3 a = 5 print(c) // c = 3 // c = 3 a.value = 5 // c = 7 { $0 + $1 }
  16. 16. ASYNCHRONOUS SLIDE 16 AdvantageREACTIVE PROGRAMMING Thread 1Thread 2Thread 3 Main ThreadobserveOn() updateView()
  17. 17. ASYNCHRONOUS SLIDE 17 AdvantageREACTIVE PROGRAMMING
  18. 18. USER INTERACTION SLIDE 18 AdvantageREACTIVE PROGRAMMING
  19. 19. USER INTERACTION SLIDE 19 AdvantageREACTIVE PROGRAMMING
  20. 20. EXTENSIBILITY SLIDE 20 AdvantageREACTIVE PROGRAMMING Example: - Array of Int - Take 3 first elements - Less than 10
  21. 21. DATA BINDING SLIDE 21 AdvantageREACTIVE PROGRAMMING
  22. 22. SLIDE 22 extensionsREACTIVE PROGRAMMING RxJava RxJS RxRuby RxSwift RxPHP Etc.
  23. 23. PROGRAMMING TRENDING SLIDE 23 BENEFIT OF REACTIVE PROGRAMMING WHAT IS REACTIVE PROGRAMMING EXTENSIONS ReviewREACTIVE PROGRAMMING
  24. 24. SLIDE 24 REACTIVE PROGRAMMING Are you ready to adopt this programming paradigm?
  25. 25. THANKS! Any questions? You can contact me: Mail: thinh.ung@asiantech.vn Phone: 097 9476275 25

×