• Like
Creating a simple doodle (drawing) like application using silverlight and reactive framework (rx)
Upcoming SlideShare
Loading in...5
×

Creating a simple doodle (drawing) like application using silverlight and reactive framework (rx)

  • 1,148 views
Uploaded on

A presentation on building a simple doodle application using the Reactive Extensions framework in Silverlight.

A presentation on building a simple doodle application using the Reactive Extensions framework in Silverlight.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,148
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  •  Asynchronous and event-based – As reflected in the title, the bread and butter of Rx’s mission statement is to simplify those programming models. Everyone knows what stuck user interfaces look like, both on the Windows platform and on the web. And with the cloud around the corner, asynchrony becomes quintessential. Low-level technologies like .NET events, the asynchronous pattern, tasks, AJAX, etc. are often too hard.  Composition – Combining asynchronous computations today is way too hard. It involves a lot of plumbing code that has little to nothing to do with the problem being solved. In particular, the data flow of the operations involved in the problem is not clear at all, and code gets spread out throughout event handlers, asynchronous callback procedures, and whatnot.  Observable collections – By looking at asynchronous computations as data sources, we can leverage the active knowledge of LINQ’s programming model. That’s right: your mouse is a database of mouse moves and clicks. In the world of Rx, such asynchronous data sources are composed using various combinators in the LINQ sense, allowing things like filters, projections, joins, time-based operations, etc.

Transcript

  • 1. Creating a simple Doodle (drawing) like application using Silverlight and Reactive Framework (RX)
    Matt Duffield, MVP, MCSD .NET
    http://mattduffield.wordpress.com
    @mattduffield
  • 2. What is the Reactive Framework?
    IEnumerator
    IObserver
    IObserver modes
    Rx keywords
    Demo code
    What we are going to cover
  • 3. Rx is a library for composing asynchronous and event-based programs using observable collections.
    Where can I use Rx?
    .NET Framework 3.5 SP1, 4
    Silverlight 3, 4, 5
    Windows Phone 7
    XNA 4.0 for Xbox 360
    Zune
    JavaScript
    What is the Reactive Framework?
  • 4. Asynchronous and event-based – as reflected in the title, the bread and butter of Rx’s mission statement is to simplify those programming models.
    Composition – combining asynchronous computations today is way too hard. It involves a lot of plumbing code that has little to nothing to do with the problem being solved.
    Observable collections – by looking at asynchronous computations as data sources, we can leverage the active knowledge of LINQ’s programming model.
    Three core properties
  • 5.
  • 6. Stock tickers
    RSS feeds
    Social media
    UI events
    GPS
    Server management
    Why does it help?
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. public interface IEnumerator
    {
    object Current { get; }
    boolMoveNext();
    void Reset();
    }
    Because we are waiting/”pulling” for a return value, these are blocking.
    IEnumerator
  • 17. public interface IObserver<T>
    {
    void OnNext(T value);
    void OnError(Exception ex);
    void OnCompleted();
    }
    We get “pushed” when a new value is available.
    IObserver
  • 18. Hot – typically values that come in from events or a web service
    Cold – known list of values from a collection, array, etc.
    IObserver modes
  • 19. FromEventPattern<T,U>
    Merge
    SkipUntil
    TakeUntil
    Throttle
    ObserveOn(Schedular.ThreadPool)
    Do
    TimeInterval – allow us to test for something over time
    Subject<>
    FromAsnyncPattern<T,U>
    Rx Keywords
  • 20. Demo
  • 21. Reactive Extensions
    http://msdn.microsoft.com/en-us/data/gg577609
    Erik Meijer and Wes Dyer Reactive Framework (RX) Under the Hood 1 of 2
    http://channel9.msdn.com/Shows/Going+Deep/E2E-Erik-Meijer-and-Wes-Dyer-Reactive-Framework-Rx-Under-the-Hood-1-of-2
    Erik Meijer and Wes Dyer Reactive Framework (RX) Under the Hood 2 of 2
    http://channel9.msdn.com/Shows/Going+Deep/E2E-Erik-Meijer-and-Wes-Dyer-Reactive-Framework-Rx-Under-the-Hood-2-of-2
    Bart de Smet
    http://channel9.msdn.com/Blogs/joshholmes/Bart-de-Smet-in-Dublin-on-the-Rx-Framework
    Jim Wooley – ThinqLinq
    http://www.thinqlinq.com/
    http://live.visitmix.com/MIX11/Sessions/Speaker/Jim-Wooley
    References
  • 22. Questions?
    Matt Duffield, MVP, MCSD .NET
    http://mattduffield.wordpress.com
    @mattduffield