IObservable <T> in .NET Framework 4.0 Beta2

Interfaces

IObservable<T>

and IObserver<T>

put directly into the namespace System

in the .NET Framework 4.0 Beta2. Why not in System.Collections.Generic

, for example IEnumerable<T>

?

ps Preview of Reactive Framework from Silverlight Toolkit contains IObserver<T>

in namespace System.Collections.Generic

.

+2


source to share


3 answers


What the new IObservable / IObserver interfaces describe is an abstraction much higher than just collections, which can be considered a special case of computation (which is why lists in Haskell are monads). Therefore, it is obvious that such a generalization is placed in the System.



Take a look at this brilliant cast from Eric Major, where he describes the ideas behind interfaces.

+2


source


IObservable is an interface that identifies the class that Observer implements . It is not related to collections. Its more to do with providing alternatives to events.



+4


source


While this is an old question I stumbled upon, I just wanted to support @ControlFlow's assessment of the "dualism" between IObservable and IEnumerable as a "Pushed based" vs "Pull based" collection with a link to Erik Meijer Rx in 15 minutes "where he can be quoted so accurately.http: //channel9.msdn.com/posts/Charles/Erik-Meijer-Rx-in-15-Minutes/

Therefore, this push-based collection can fundamentally change the basic paradigm of the "mundane series of triggered events" to an asynchronous, selectable, queryable, available and subscribe collection of first-class declarative action. What does this belongs to the main BCL namespace, or perhaps deserves it, but is too far from Yet-Another-Collection to share its namespace. Keep in mind that only my opinion.

+1


source







All Articles