Why doesn't .NET have a built-in Observer pattern like Java?

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?

+3
source share
5 answers

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.

, Observer .NET .

+13

.NET . Java ( Observable) " " .

+6

, , , , .

.Net 4, - .

longhand, . .

+4
+3

. . , , , , , , . .

+1

Source: https://habr.com/ru/post/1760028/


All Articles