Sunday, 13 May 2007

THE STRATEGY PATTERN

The Strategy Design Pattern

The Strategy Design Pattern fundamentally consists of a way to separate an algorithm from their host, and enclosing algorithm into a different separate class. startegy patten does allow you to switch the algorithm that you where using at any time of your design.
Some of the avantages that strategy pattern allow you to do is to keep track of the behaviours that you want your object to perform.



Saturday, 12 May 2007

DECORATOR PATTERN

DECORATOR PATTERN

After the class, i did some research on the decorator pattern and ii find out that its one of the most important of the 23 pattern types. Some of the reason why i said its important is that is flexible and you can do what ever you want to do with it. that is why i come up with this defination of decorator pattern.
Decorator pattern is the design pattern that allow additional or new behavious to be added to an existing design dynamically.
The example i can give for easy understanding of a decorator is, when you go to a chinese restarant to buy food, you can buy your rice and as them to add some aditive food to it, like chicken wing, ribs, soup and so on. So all the ribs, chicken wing and soup are all decorator.



REFERENCES

http://www.exciton.cs.rice.edu/JavaResources/DesignPatterns/DecoratorPattern.htm