Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nov 200391.3913 Ron McFadyen1 Figure 23.21 The Observer Pattern in a DCD.

Similar presentations


Presentation on theme: "Nov 200391.3913 Ron McFadyen1 Figure 23.21 The Observer Pattern in a DCD."— Presentation transcript:

1 Nov 200391.3913 Ron McFadyen1 Figure 23.21 The Observer Pattern in a DCD

2 Nov 200391.3913 Ron McFadyen2 Figure 23.22 a window subscribing When a SaleFrame1 (the subscriber) is initialized, it subscribes to the Sale (the publisher)

3 Nov 200391.3913 Ron McFadyen3 Figure 23.23 a sale publishing a change A Sale receives a message changing its state. The Sale invokes its method, publishPropertyEvent, which will in turn notify any subscribers of the change Note the activations for the sale

4 Nov 200391.3913 Ron McFadyen4 Figure 23.24 a window receiving notification The window receives notification of the state change and modifies its display appropriately Notice that this is a continuation from the previous sequence diagram

5 Nov 200391.3913 Ron McFadyen5 Class Diagram Customer +attach() +detach() +notify() +getState() +setState() +update() WelcomeLetter AddrVerification BrickAndMortar > Subject +attach() +detach +notify() > Observer

6 Nov 200391.3913 Ron McFadyen6 Composite > ISalePricingStrategy PercentDiscount PicingStrategy AbsoluteDiscount OverThreshold PicingStrategy Composite PicingStrategy 1..* Sale *1


Download ppt "Nov 200391.3913 Ron McFadyen1 Figure 23.21 The Observer Pattern in a DCD."

Similar presentations


Ads by Google