Update README.md

This commit is contained in:
Ilkka Seppälä 2014-09-06 23:33:48 +03:00
parent ee54d6a3ea
commit ab315782ec

View File

@ -244,7 +244,9 @@
# Frequently asked questions
**Q: What is the difference between State and Strategy patterns?**
A: While the implementation is similar they solve different problems. The State pattern deals with what state an object is in - it encapsulates state-dependent behavior. The Strategy pattern deals with how an object performs a certain task - it encapsulates an algorithm.
While the implementation is similar they solve different problems. The State pattern deals with what state an object is in - it encapsulates state-dependent behavior. The Strategy pattern deals with how an object performs a certain task - it encapsulates an algorithm.
**Q: What is the difference between Strategy and Template Method patterns?**
A: In Template Method the algorithm is chosen at compile time via inheritance. With Strategy pattern the algorithm is chosen at runtime via composition.
In Template Method the algorithm is chosen at compile time via inheritance. With Strategy pattern the algorithm is chosen at runtime via composition.