It seems that the observer design pattern is in built in C# through its event delegate model. Is there any reason where I may have to implement it in the classical way?
regards
123Developer
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.
Typically, the event model built into the language will be sufficient for the observer pattern. There is really no reason to implement it in a different way, since you’re just recreating events.
That being said, there are rare times when people change the “standard” event pattern. For example, I have seen cases where people want to raise events asynchronously. I typically don’t recommend this (I, personally, think this is better handled on the subscriber’s side), but it still can be handled via a standard C# event, but raising the event changes slightly (using GetInvocationList and asynchronously calling the delegates).