What is the difference between observable collections and enumberable ones?
What is an observable collection and how it is different than a enumerable colle开发者_如何学Pythonction?
An observable collection implements the famous "Observer" design pattern. It is one of the design patterns that are listed in the famous book of the GOF.
The basic idea is as follows - if several objects has some dependency on the same object, such that when some interesting things happen inside that object, all those dependent objects should be notified about the event immediately, then this pattern is used. Here we call the dependent objects as the "Observer", and the objects onto which they all are depending as "Subject". When some event happens inside the subject, it is the responsibility of the subject to notify all the observers about this event. To facilitate this sort of message passing, all the observers has to subscribe to the subject when they are created. Details can be found here.
精彩评论