rust-unofficial / patterns

A catalogue of Rust design patterns, anti-patterns and idioms
https://rust-unofficial.github.io/patterns/
Mozilla Public License 2.0
8.02k stars 366 forks source link

Design Patterns, Strategy has unclear identifier `Context` and `run` mentioned. #341

Closed ppyrzanowski closed 1 year ago

ppyrzanowski commented 1 year ago

A Context invariant and a run associated function are mentioned in the Strategy Pattern without any further explanation. I have the assumption that the example has been refactored but the description has been left unchanged, however, the file history does not show any major changes to the file.

A solution I propose and could complete is, cutting out any obscure mentioned identifiers in the description leaving the example as is.

Another solution is to give further context/sources/references to the obscure identifiers. This will probably include additions to the example.

I personally found the example very instructive and clear and would advocate to it leave unchanged.

simonsan commented 1 year ago

Do you want to open a PR with the changes you propose?