Observer Pattern C#

Observer

When do we go for event driven programming in our application? Why Action driven programming.  — When a state change in object(Data is altered, then certain algorithm should be executed) should execute certain piece of logics, then we should go for event driven programming. SendSMS is the algorithm to be executed when balance is credited/debited.

Data : Account Balance (which undergo change because of publisher)

Publisher : Update Method : who will raise the signal

Signal : Event/Listener

Observer : MessageCreator.SendSms

One to many : One publisher raises the signal to many Observers.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s