Click here to Skip to main content
15,896,201 members
Articles / Web Development / ASP.NET

Implementing the Observer Pattern

Rate me:
Please Sign up or sign in to vote.
3.48/5 (13 votes)
5 Feb 2008CPOL4 min read 64.8K   302   41  
An article that discusses how to implement the observer pattern
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace ObserverTutorial.App_Code
{
    [Serializable]
    public class AddressEntity
    {
        public AddressEntity()
        {
            this.EntityID = 0;
            this.CountryName = String.Empty;
            this.CityName = String.Empty;
            this.PostalCode = String.Empty;
            this.Buliding = String.Empty;
            this.Street = String.Empty;
            this.State = String.Empty;

            this.CreatedBy = String.Empty;
            this.CreationDate = new DateTime();
            this.LastModificationDate = new DateTime();
            this.LastModifiedBy = String.Empty;
            this.Status = String.Empty;

        }

        String m_CountryName;
        public String CountryName
        {
            get { return m_CountryName; }
            set { m_CountryName = value; }
        }

        String m_CityName;
        public String CityName
        {
            get { return m_CityName; }
            set { m_CityName = value; }
        }

        String m_PostalCode;
        public String PostalCode
        {
            get { return m_PostalCode; }
            set { m_PostalCode = value; }
        }

        String m_Buliding;
        public String Buliding
        {
            get { return m_Buliding; }
            set { m_Buliding = value; }
        }

        String m_Street;
        public String Street
        {
            get { return m_Street; }
            set { m_Street = value; }
        }

        String m_State;
        public String State
        {
            get { return m_State; }
            set { m_State = value; }
        }

        #region "Entity Details"

        DateTime m_CreationDate;
        public DateTime CreationDate
        {
            get { return m_CreationDate; }
            set { m_CreationDate = value; }
        }

        DateTime m_LastModificationDate;
        public DateTime LastModificationDate
        {
            get { return m_LastModificationDate; }
            set { m_LastModificationDate = value; }
        }

        String m_CreatedBy;
        public String CreatedBy
        {
            get { return m_CreatedBy; }
            set { m_CreatedBy = value; }
        }

        String m_LastModifiedBy;
        public String LastModifiedBy
        {
            get { return m_LastModifiedBy; }
            set { m_LastModifiedBy = value; }
        }

        String m_Status;
        public String Status
        {
            get { return m_Status; }
            set { m_Status = value; }
        }

        int m_EntityID;
        public int EntityID
        {
            get { return m_EntityID; }
            set { m_EntityID = value; }
        }

        # endregion

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer NTS
Palestinian Territory (Occupied) Palestinian Territory (Occupied)
Huthaifa lives happily in Jerusalem and enjoys his time developing web applications and learning new stuff.

Comments and Discussions