开发者

What is the difference between observable collections and enumberable ones?

开发者 https://www.devze.com 2022-12-24 09:18 出处:网络
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 de

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号