Skip to content

Commit dd855a3

Browse files
committed
Added anchors to frequently asked questions.
1 parent 92db946 commit dd855a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,15 +415,15 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi
415415

416416
# Frequently asked questions
417417

418-
**Q: What is the difference between State and Strategy patterns?**
418+
**<a id="Q1">Q: What is the difference between State and Strategy patterns?</a>**
419419

420420
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.
421421

422-
**Q: What is the difference between Strategy and Template Method patterns?**
422+
**<a id="Q2">Q: What is the difference between Strategy and Template Method patterns?</a>**
423423

424424
In Template Method the algorithm is chosen at compile time via inheritance. With Strategy pattern the algorithm is chosen at runtime via composition.
425425

426-
**Q: What is the difference between Proxy and Decorator patterns?**
426+
**<a id="Q3">Q: What is the difference between Proxy and Decorator patterns?</a>**
427427

428428
The difference is the intent of the patterns. While Proxy controls access to the object Decorator is used to add responsibilities to the object.
429429

0 commit comments

Comments
 (0)