locked
RX versus Events RRS feed

  • Question

  • Considering how much Microsoft is encouraging us to use RX wherever we have events, can we expect to see a day when there's a version of .Net that removes support for events entirely, including all UI events like the click of a command button? The current way of converting an event to an observable using FromEvent seems like a workaround, as if FromEvent is a bridge between the old, or shall we say "classic", .Net to the next-gen .Net.

    Or will events have its own space that RX cannot intrude into?

    Thursday, June 10, 2010 10:44 AM

Answers

  • James is correct. Rx is intended complementary to existing patterns such as events, APM, etc. Not a replacement. 
    Thursday, June 10, 2010 2:48 PM

All replies

  • I don't think that is ever going to happen. Events still have their place.

    What would be nice is if delegates (and events) implemented IObservable in some way.

    So you could write this;

    MyEvent += SomeMethod

    or this;

    from e in MyEvent
    select e

    • Proposed as answer by LeeCampbell Thursday, June 10, 2010 6:14 PM
    Thursday, June 10, 2010 11:13 AM
  • James is correct. Rx is intended complementary to existing patterns such as events, APM, etc. Not a replacement. 
    Thursday, June 10, 2010 2:48 PM
  • Hi,

    The following discussion provides a comparison (probably not exhaustive) of classic event features that Rx doesn't currently support and probably never will, IMO, simply because events have additional semantics that observables do not; e.g., the observable contract is different from that of an event.  They branch since the observable contract is more expansive; e.g., observables can be cold.  And events are part of the type system so they support other aspects of the .NET Framework that observables cannot; e.g., reflection and attributes.

    http://social.msdn.microsoft.com/Forums/en/rx/thread/2019a946-5238-4527-80e5-4bce8d931f77

    - Dave


    http://davesexton.com/blog
    Thursday, June 10, 2010 3:59 PM