I wonder why in the .NET Framework there are no pairs (Observer / Observable) similar to Java?
EDIT: Yes, I know about events and delegates, but using these interfaces is a simple and book-like approach to this DP, right?
In .NET 4, it does the following: System.IObservable<T>and System.IObserver<T>(which are Dual IEnumerable<T> and IEnumerator<T>). Take a look at the Reactive Extensions (Rx) project for compositing these interfaces with asynchronous events.
System.IObservable<T>
System.IObserver<T>
IEnumerable<T>
IEnumerator<T>
, Observer .NET .
.NET . Java ( Observable) " " .
, , , , .
.Net 4, - .
longhand, . .
Events. Observer. : http://en.wikipedia.org/wiki/Observer_pattern
. .
. . , , , , , , . .
Source: https://habr.com/ru/post/1760028/More articles:notification of a user about a successful update in the encoder - phpСоздание рекламной системы для ваших веб-сайтов (мой собственный AdSense) - phpБинарная совместимость Java - RFC на предлагаемом решении для ковариантного типа возврата с использованием invokevirtual semantics - javaКакой запрос на выборку CoreData действительно возвращается? - objective-cThe fastest way to convert Cairo Surface to Pygame on OS-X - pythonSearch container without blocking - delphiHow to compare two variables of type HANDLE - c ++Do Eclipse autocomplete behave like Visual Studio intellisense? - eclipseTSQL RAND random values - sqlCheck username / email address - javascriptAll Articles