Nov Ron McFadyen1 Figure The Observer Pattern in a DCD
Nov Ron McFadyen2 Figure a window subscribing When a SaleFrame1 (the subscriber) is initialized, it subscribes to the Sale (the publisher)
Nov Ron McFadyen3 Figure 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
Nov Ron McFadyen4 Figure 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
Nov Ron McFadyen5 Class Diagram Customer +attach() +detach() +notify() +getState() +setState() +update() WelcomeLetter AddrVerification BrickAndMortar > Subject +attach() +detach +notify() > Observer
Nov Ron McFadyen6 Composite > ISalePricingStrategy PercentDiscount PicingStrategy AbsoluteDiscount OverThreshold PicingStrategy Composite PicingStrategy 1..* Sale *1