Skip to content

Commit

Permalink
Review issues fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Lindegger committed Nov 20, 2019
1 parent 53268ba commit f4757ab
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions docs/input/docs/getting-started/principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ Description: Core principles of BBT.StrategyPattern.

Goal of this infrastructure is to support the providing of specific strategies achieved by using generics.
This infrastructure introduces a generic strategy interface managed by the generic strategy provider.
The library introduces an `IGenericStrategy<T>` which needs to be implemented for every case a strategy with a given criterion is supporting. The instances of the `IGenericStrategy<T>` are managed by the `IGenericStrategyProvider<out TStrategy, in TCriterion>` which resolves the correct implementation for the given criterion.
The library introduces an `IGenericStrategy<T>` which needs to be implemented for every case a strategy with a given criterion is supporting.
The instances of the `IGenericStrategy<T>` are managed by the `IGenericStrategyProvider<out TStrategy, in TCriterion>` which resolves the correct implementation for the given criterion.
The generic parameter acts as selection criterion and declares the responsibility of the specific strategy.
The generic strategy interface leads to more structured code.
Based on their generic type parameter, strategies are categorized and make their responsibility explicit.
As a consequence this leads to higher chance of reuse and better readable code.
The implementation is driven by SOLID principles like open/closed, single responsibility and dependency inversion.
For further explanations see [Fundamentals of strategy pattern]

## Advantages

* The generic strategy interface leads to more structured code.
* Based on their generic type parameter, strategies are categorized and make their responsibility explicit. As a consequence this leads to higher chance of reuse and better readable code.
* The implementation is driven by SOLID principles like open/closed, single responsibility and dependency inversion. For further explanations see [Fundamentals of strategy pattern].

## Implementation details

* Introduces a generic strategy interface
* The generic parameter represents the criterion for the selection of the specific strategy
* Works with any IoC framework
* Supports generic type unbound IoC registrations
* For most benefit make generic type unbound IoC registration for `GenericStrategyProvider<,>`

[Fundamentals of strategy pattern]: ./fundamentals
4 changes: 2 additions & 2 deletions docs/input/docs/getting-started/whystrategypattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Title: Why does BBT.StrategyPattern exist?
Description: Introduction to BBT.StrategyPattern, what problems are solved and how it is distinctive from other implementations of strategy pattern.
---

BBT.StrategyPattern is an implementation of the strategy design pattern.
BBT.StrategyPattern is a generic implementation of the strategy design pattern.

## Features:
## Features

* Support the usage of strategies with no need to implement specific strategy factories
* Provide a generic strategy provider based on generics
Expand Down

0 comments on commit f4757ab

Please sign in to comment.