Observer pattern
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Observer pattern

on

  • 794 views

Observer pattern explained

Observer pattern explained

Statistics

Views

Total Views
794
Views on SlideShare
758
Embed Views
36

Actions

Likes
0
Downloads
10
Comments
0

1 Embed 36

http://geekswithblogs.net 36

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Observer pattern Presentation 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