0

These days, I am learning Gof design patterns in C# and I think event-handling might have something to do with Observer pattern. My question is while solving problems with events and their handlers, why we still need observer pattern?

1 Answer 1

1

Your question is comparing apples and pears.

The observer pattern is a solution to a problem. It doesn't tell you how to implement the solution, but is more like a blue print.

Thus, the event model in .NET is an implementation of the observer pattern. The EventHandler delegate is defining the observer and the event keyword takes care of dealing with all notifications in the subject, just as defined in the observer pattern.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.