Programming Reactive Extensions and LINQ

  • 2h 25m
  • Jesse Liberty, Paul Betts
  • Apress
  • 2011

Pro Reactive Extensions and LINQ is a deep dive into the next important technology for .NET developers: Reactive Extensions. This in-depth tutorial goes beyond what is available anywhere else to teach how to write WPF, Silverlight, and Windows Phone applications using the Reactive Extensions (Rx) to handle events and asynchronous method calls.

Reactive programming allows you to turn those aspects of your code that are currently imperative into something much more event-driven and flexible. For this reason, it’s sometimes referred to as LINQ for Events.

Reactive programming hinges on the concept of the observable collection, as opposed to the simple enumerable collection with which we’re all familiar. For example, to extract data from a collection and add it to a list box, you would traditionally iterate through the list box, extracting each object in turn. This approach works fine, but it requires significant knowledge about the data you’re working with, which can be limiting. In Rx programming, you're instead informed about each object in turn and then free to react to each notification however you like, which affords much greater flexibility.

This book shows you how reactive programming can be applied to a range of situations—from WPF applications to Windows Phone apps—to improve coding efficiency and boost performance.

What you’ll learn

  • How to create, debug and manage reactive extensions in many situations
  • The observer pattern and how it can be applied to your projects
  • How to avoid spaghetti code by using Rx to manage your asynchronous methods
  • How to use SelectMany to explore the heart of the Reactive Extensions
  • How to come to grips with the reactive user interface framework for building both small and large applications

Who this book is for

This book will be most beneficial to existing .NET developers with a grounding in WPF, Silverlight and C#, who want to take their skills further using the powerful reactive programming approach.

About the Authors

Jesse Liberty is a senior developer-community evangelist on the Microsoft Windows Phone team. He hosts the popular "Yet Another Podcast" on his blog. The entire blog is required reading. Liberty is the co-author of numerous top-selling books, including Migrating to Windows Phone 7 by (Apress, 2011) and Programming C#4.0 (O'Reilly Media, 2010). Prior to Microsoft, he was a distinguished software engineer at AT&T, a software architect for PBS, and vice president of information technology at Citibank.

Paul Betts is a software developer and Hubbernaut at GitHub, where he works on bringing the joy of Git and GitHub to the world of .NET and Windows. Paul previously worked at Microsoft in the Windows and Office organizations.

In this Book

  • Foreword
  • Introduction
  • Introducing LINQ and Rx
  • Core LINQ
  • Core Rx
  • Practical Rx
  • Inside Rx
  • LINQ to SQL
  • Reactive Extensions for JavaScript
  • ReactiveUI
  • Testing with Rx