I wonder why .NET framework doesn’t have pair (Observer/Observable) interfaces similar to Java’s feature?
EDIT:
yes i know about events and delegates but using those interfaces is a simple and bookish approach of this DP isn’t it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In .NET 4 it does:
System.IObservable<T>andSystem.IObserver<T>(which are a Dual ofIEnumerable<T>andIEnumerator<T>). Look at the Reactive Extensions (Rx) project for compositional use of these interfaces with asynchronous events.More generally, the Observer pattern is better served in .NET with events.