Implementing Observer in ASP.NET
page 1 of 5
Published: 13 Aug 2007
Abstract
This article will show you how you can implement the observer pattern in ASP.NET applications.
by Brian Mains
Feedback
Average Rating: 
Views (Total / Last 10 Days): 31751/ 37

Introduction

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.


View Entire Article

User Comments

Title: Puedes pasar el codigo   
Name: anonimo
Date: 2011-04-27 9:41:30 PM
Comment:
proyect? please
Title: incomplete code   
Name: lokeshsp
Date: 2008-08-07 8:18:04 AM
Comment:
Incomplete code

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-04-18 8:53:54 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search