Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight ObservableCollection v. Reactive Extensions for .NET (Rx)

I figure I'm missing something here but I was just reading this article by jesse liberty regarding Reactive Extensions for .Net. His example is for Window Phone 7 using Silverlight, but Silverlight also has an ObservableCollection data type. So I'm trying to figure out what the difference ... perhaps the Rx is more powerful?

Can anyone compare and contrast these? When would I use one over the other?

Thanks

like image 618
Gern Blanston Avatar asked Feb 03 '11 16:02

Gern Blanston


1 Answers

ObservableCollection and RX have only one thing in common - the word Observable.

That's it.

ObservableCollection is an UI-oriented class that implements INotifyCollectionChanged.

Reactive Extensions is a library built around the IObservable and IObserver interfaces, which are not directly related to the UI (thought it can be used successfully in UI scenarios).

like image 153
Sergey Aldoukhov Avatar answered Nov 15 '22 11:11

Sergey Aldoukhov