The past couple of days i've been reading different web blogs\articles about the observer pattern vs delegates\events and all the articles basically end the same with delegates and events there's is no longer a need for the Observer Pattern and it also is less coupled than the observer. Since all the articles ended the same way i'm quite certain there is something i'm missing hence the post.
take this blog for example
I just don't see how this is less coupled because it seems to me for the observer to attach\observe there is going to have to be statement somewhere
. If that's true then the observer has to know the about that specific class. how can that be better?
like i said in all the articles i read delegate/events won so I know i'm wrong i just hope someone can explain why.
take this blog for example
I just don't see how this is less coupled because it seems to me for the observer to attach\observe there is going to have to be statement somewhere
Code:
MySubject.NotifyEvent+= new NotifyHandler(somemethodwithmatchingsignature)
like i said in all the articles i read delegate/events won so I know i'm wrong i just hope someone can explain why.