Skilled Coder
Jan 6, 2024

--

Or simply you may want to additional actions (e.g., logging) before and after execution.

OperationStrategy typically represents a pure algorithm or behavior, whereas Command adds a layer of flexibility by allowing for additional actions or behaviors beyond the core strategy. Command encapsulates the strategy along with information about how it should be executed, making it more versatile.

Hopefully this clear your doubt.

--

--

Skilled Coder
Skilled Coder

Written by Skilled Coder

Sharing content and inspiration on programming. Coding Newsletter : https://skilledcoder.substack.com

Responses (1)