Design Patterns

Friday, May 19, 2006

Behavioral Patterns continued -Lecture 8

Observer pattern

This pattern lets all the objects who are registered with it, know about any changes that happen immediately. its more of a one to many relationship between objects. A practical example of the observer is the way the news stations work with their reporters. In an event when something happens in the country that concerns its citizen, e.g war news, they braodcast the news to all the citizens in the country through T.V and radio almost immediately.

Visitor pattern

Visitor allows an operation to be carried on an object structure without changing the classes of the the elements on which it operates on. This means that, take for example while you are surfing on the web, there are pop up adverts that come on your screen whilst it allows you to continue with what ever you were doing. These are called intelligent agents

Reference:

Eric Freeman and Elizabeth Freeman with Kathy Sierra & Bert Bates (2004) Head First Design Patterns pg 638

0 Comments:

Post a Comment

<< Home