简体   繁体   中英

What is the difference between the Observer and Subject-Observer patterns

While watching some videos on Channel 9 about the Reactive Extensions for .NET, someone asked whether the Reactive Extensions library is an implementation of the Observer pattern. The presenter then went on to answer by saying that the library is an implementation of the Subject Observer pattern. This leads me to believe that there is possibly a difference between the two patterns.

Is there a difference between these two patterns? If so, what is the difference. Links to articles will be helpful too.

From the GoF book, the Observer pattern is illustrated by using Subject and Observer. The Subject holds a list of Observers and notifies them of any state change (usually by calling their "notify" method).

I wouldn't know what they would be talking about but that's basically it.

Wiki on Observer Pattern .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM