Work towards #56: Splitting up the README

I did the job and splitted up the readme, hopefully everything was
splitted correctly...
This commit is contained in:
Markus
2015-08-13 23:54:40 +02:00
parent ea524ee2c0
commit fbb12b53ba
58 changed files with 1205 additions and 759 deletions

20
strategy/index.md Normal file
View File

@ -0,0 +1,20 @@
---
layout: pattern
title: Strategy
folder: strategy
categories: pattern_cat
tags: pattern_tag
---
**Intent:** Define a family of algorithms, encapsulate each one, and make them
interchangeable. Strategy lets the algorithm vary independently from clients
that use it.
![alt text](./etc/strategy_1.png "Strategy")
**Applicability:** Use the Strategy pattern when
* many related classes differ only in their behavior. Strategies provide a way to configure a class either one of many behaviors
* you need different variants of an algorithm. for example, you might define algorithms reflecting different space/time trade-offs. Strategies can be used when these variants are implemented as a class hierarchy of algorithms
* an algorithm uses data that clients shouldn't know about. Use the Strategy pattern to avoid exposing complex, algorithm-specific data structures
* a class defines many behaviors, and these appear as multiple conditional statements in its operations. Instead of many conditionals, move related conditional branches into their own Strategy class