Review Strategy Pattern
Inclass Practice Final
If there is time we will review observer pattern.
- Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
Observer is a design pattern that is often used to publish (push) or subscribe (pull) changes in the stae of one object to other interested object. It encourages loose coupling of objects.
The object the get the data often called the subject then notifies the observing objects of the change. The observing object will often respond to the subject.
Here is a real example in c#. In this example a stock (the subject) notifies and investor (the observer) of a change in price.
Here's and example of a windows app the uses the observer pattern
Here is the start of a web app that does the same
Practice final not graded.
Review next week