Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unknown Context identifier #366

Merged
merged 3 commits into from
Apr 26, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/patterns/behavioural/strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ format, or just modify one of the existing formats.

## Example

In this example our invariants (or abstractions) are `Context`, `Formatter`,
and `Report`, while `Text` and `Json` are our strategy structs. These strategies
In this example our invariants (or abstractions) are `Formatter` and `Report`, while `Text` and `Json` are our strategy structs. These strategies
have to implement the `Formatter` trait.

```rust
Expand Down Expand Up @@ -98,8 +97,9 @@ fn main() {
The main advantage is separation of concerns. For example, in this case `Report`
does not know anything about specific implementations of `Json` and `Text`,
whereas the output implementations does not care about how data is preprocessed,
stored, and fetched. The only thing they have to know is context and a specific
trait and method to implement, i.e,`Formatter` and `run`.
stored, and fetched. The only thing they have to know is a specific
trait to implement and its method defining the concrete algorithm implementation processing
the result i.e,`Formatter` and `format(...)`.
MarcoIeni marked this conversation as resolved.
Show resolved Hide resolved

## Disadvantages

Expand Down