You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be neat if we could call other commands from within a command. For example, if someone calls the -handler command without an argument, it would be nice if the -help handler command was returned.
Ideas
I think we can use the Strategy Design Pattern, and make a strategy for each command. That way it get's decoupled from the command itself, making it less dependent on it, thus making it easier to call from other contexts.
Snailedlt
changed the title
Make commands able to call each other without repeating code, or tight coupling
Make commands able to call each other without repeating code, and without tight coupling
Oct 5, 2021
Description
It would be neat if we could call other commands from within a command. For example, if someone calls the
-handler
command without an argument, it would be nice if the-help handler
command was returned.Ideas
I think we can use the Strategy Design Pattern, and make a strategy for each command. That way it get's decoupled from the command itself, making it less dependent on it, thus making it easier to call from other contexts.
Strategy Design Pattern explanation:
https://www.youtube.com/watch?v=SicL4fYCz8w
Example usage:
https://github.com/andreidimaano/Isabelle
https://github.com/andreidimaano/Isabelle/tree/master/src/strategy
Possible dependencies
The text was updated successfully, but these errors were encountered: