Observer Pattern
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Observer Pattern

on

  • 1,139 views

 

Statistics

Views

Total Views
1,139
Views on SlideShare
1,127
Embed Views
12

Actions

Likes
0
Downloads
8
Comments
0

3 Embeds 12

http://www.slideshare.net 6
http://albert-myptc.blogspot.com 4
http://albert-myptc.blogspot.tw 2

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 Pattern
    Albert Guo
    junyuo@gmail.com
    1
  • 2. Motivation
    Intent
    Implementation
    Applicability & Examples
    Agenda
    2
  • 3. Let's assume we have a stock system which provides data for several types of client. We want to have a client implemented as a web based application but in near future we need to add clients for mobile devices, Palm or Pocket PC, or to have a system to notify the users with sms alerts. Now it's simple to see what we need from the observer pattern: we need to separate the subject(stocks server) from it's observers(client applications) in such a way that adding new observer will be transparent for the server.
    Motivation
    3
  • 4. Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
    Intent
    4
  • 5. Implementation
    5
  • 6. 6
    Implementation – cont.
  • 7. 7
    Applicability & Examples
  • 8. 8
    Applicability & Examples – cont.
  • 9. 9
    Applicability & Examples – cont.
  • 10. 10
    Applicability & Examples – cont.
  • 11. 11
    Applicability & Examples – cont.
  • 12. 12
    Applicability & Examples – cont.
  • 13. 13
    Applicability & Examples – cont.
    Email Subscriber: 《集中市場》三大法人賣超79億元,法說會績優股力抗國際崩跌
    SMS Subscriber: 《集中市場》三大法人賣超79億元,法說會績優股力抗國際崩跌
    RSS Subscriber: 《集中市場》三大法人賣超79億元,法說會績優股力抗國際崩跌
    ----------------------------------------------------
    Email Subscriber: 台股盤後-鴻家軍登高力抗希臘債信危機 開低拉高力守8000關
    SMS Subscriber: 台股盤後-鴻家軍登高力抗希臘債信危機 開低拉高力守8000關
    RSS Subscriber: 台股盤後-鴻家軍登高力抗希臘債信危機 開低拉高力守8000關
    ---------------------------------------------------