I have spent the last couple of weeks researching the above area, especially in relation to an observable C# library I built a couple of years ago. A lot has happened since, but the event that sticks out the most (and caused me to re-investigate) was the Reactive (Rx) Framework that leaked out with the Silverlight Toolkit. This post has a handy guide to moving Rx to the desktop .NET platform, from the Silverlight core. Most research involved watching hours of (mostly repetitive) video, but it all got through in the end.
Whilst the theoretical framework behind the monad/monoid/"dual of IEnumerable" is pretty interesting, I cant help but be left with the feeling that something's been missed here. The whole thing really did not make any sense to me (in relation to creating an observable/reactive framework) until the following clicked: this is not about collections.
I generally use the IEnumerable construct day-to-day to navigate collections, of one form or another. I had mistakenly thought that the mathematical dual of IEnumerable would "reverse" it's behaviour in some kind of real-world scenario. Here I was thinking some collection/enumerable object that you could subscribe to. It turns it it is, of a kind, except the dimension is totally different. Whilst there is a spatial data dimension in collections I would use IEnumerable; the dimension of IObservable is time. IObservable allows you to observe an individual value over time in an event-driven form, whilst IEnumerable allows you to navigate your own way along a collection of items.
If I had thought of IEnumerable being used to extract the evolving changes of a discrete value over time, then maybe IObservable would have made perfect sense; but the fact is I saw IEnumerable being useful to navigate over a collection of completely separate items/values/objects.
Now this has all clicked into place, I need to apply my observable library which is more focused on collections. I observable collections, where the collection members themselves are changing and can be queried. From what I've seen so far, Rx is more focused on events/discrete values which is a different thing from handling inserts/changes/deletes to a set.
My view is the Reactive Framework is totally going to change the way apps are developed (for me at least anyway) - just like Linq in general has already.
Thursday, September 24, 2009
Continuous / Observable / Linq / to Events
Labels:
.NET,
C#,
Linq to Events,
Observable,
Reactive,
Rx Framework
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment