Reactive Android Development CS 4593-02T & CS 5463-01T Summer 2016 RxAndroid
Iterators Provide a consistent interface to accessing the elements of arbitrary data structures.
Iterators Provide a consistent interface to accessing the elements of arbitrary data structures. <setup> For(<type> e : E) { <update logic> } <finish>
Iterators Example: arithmetic mean Integer sum = 0; For(Integer e : A) { sum += e; } Integer average = sum / A.size();
Observer Pattern Provides a means of registering for new values
Rx Additions to Observer Pattern Provides a means of registering for new values And A means of signaling that no more values are coming A means of signaling that an error occurred
Rx Additions to Observer Pattern Provides a means of registering for new values And A means of signaling that no more values are coming A means of signaling that an error occurred Without using Optional or Either
Reactive Replacement for Iterators With these additions, a listener can perform an action similar to that of iteration on data that is arriving asynchronously.
Observables The basic element of Rx Two types: Hot Cold
Observables The basic element of Rx Two types: Hot Cold Comparable to Sodium Streams Cold
Observables The basic element of Rx Two types: Hot Cold Comparable to Sodium Streams Cold Delivers data from a fixed source whenever anyone subscribes
Observables The basic element of Rx Two types: Hot Cold Comparable to Sodium Streams Cold Delivers data from a fixed source whenever anyone subscribes Starting from the beginning
Observables The basic element of Rx Two types: Hot Cold Comparable to Sodium Streams Cold Delivers data from a fixed source whenever anyone subscribes Starting from the beginning Can be handy for experimenting
Marble Diagram
Resources http://rxmarbles.com http://reactivex.io Interactive marble diagrams (when not on iOS, apparently!) http://reactivex.io The 'Docs' menu at the top provides links