Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

December 29, 2011

Strategy Pattern

Key points :

1. Also known as Policy pattern
2. Collection of Algos (Behavuours)
3. Algo can be selected at runtime
4. Uses composition instead of inheritance

e.g. a class used for validation of incoming data may use strategy pattern in which the validation algo will be decided on the basis of data set

No comments: