Your SlideShare is downloading. ×
  • Like
Observer pattern
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Observer pattern

  • 548 views
Published

Observer pattern explained

Observer pattern explained

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
548
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
11
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Observer PatternShahriar Iqbal Chowdhury & Monjurul Habib Code Name: Remington http://www.facebook.com/groups/netter/
  • 2. Observer Defined• Hes a silent guardian. A watchful protector. A Dark Knight.
  • 3. Pattern States Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically
  • 4. Applicability• When an abstraction has two aspects, one dependent on the other. Encapsulating these aspects in separate objects lets you vary and reuse them independently.• When a change to one object requires changing others, and you dont know how many objects need to be changed.• When an object should be able to notify other objects without making assumptions about who these objects are. In other words, you dont want these objects tightly coupled.
  • 5. Observer @ Gotham City
  • 6. Example (Notify on Withdrawal)
  • 7. Subject
  • 8. Concrete Subject
  • 9. Observer
  • 10. ConcreteObserverConcreteObserver
  • 11. Invoke
  • 12. Advantages1. Eliminates dependencies2. Increases extensibility3. Improves testability
  • 13. Observer & .NET framework• Model View Controller Pattern - The observer pattern is used in the model view controller (MVC) architectural pattern. In MVC the this pattern is used to decouple the model from the view. View represents the Observer and the model is the Observable object.• The introduction of delegates and events provides a new and powerful means of implementing the Observer pattern