The observer pattern is a design pattern, largely
popularized by the Gang of Four, which allows objects to receive notifications
from another object. Imagine a newsletter signup page, where you can signup for
various newsletters that are broadcasted by email. There needs to be the ability
to signup multiple users for one newsletter; after all, it would be a shame to
create only a one-to-one relationship. Rather, there needs to be a one-to-many
relationship, with the many part being an open-ended amount of people.
It is possible to set this up in a .NET application as well.
A subject (the newsletter) has one or many observers (newsletter subscribers)
of that subject. Whenever the subject needs to broadcast some sort of change,
all of the observers get notified of that change. In the newsletter example,
when a newsletter changes its content, it is broadcasted to the subscribers. This
can be more difficult to setup in ASP.NET because of some of the limitations
that occur with the stateless environment. However, it is possible and this
article will show you how.