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
CommandRunner currently handles executing all of the 'system'
command that we have specified.
This violates the Single Responsibility Principle.
The current design is also inflexible, as whenever we wish to add
a new command (or an existing command with different parameters),
we would need to hardcode a new method for it.
We can consider using the Command + Builder pattern, like JGit GitCommands
to split the responsiblities of each 'common' command to their own classes.
This will allow for commands to be reused with new parameters (without
affecting existing usages), and also
easier unit testing as we can control which parameter to add (instead of
having to set up the entire RepoConfiguration).
The text was updated successfully, but these errors were encountered:
All the git commands are embedded in the CommandRunner class.
This violates the Single Responsibility Principle as CommandRunner
should only be responsible for the execution, and not the type of
commands.
As a step towards deprecating the use of CommandRunner, let's export
the commands to respective classes and remove the direct dependency on
CommandRunner.
CommandRunner currently handles executing all of the 'system'
command that we have specified.
This violates the Single Responsibility Principle.
The current design is also inflexible, as whenever we wish to add
a new command (or an existing command with different parameters),
we would need to hardcode a new method for it.
We can consider using the Command + Builder pattern, like JGit GitCommands
to split the responsiblities of each 'common' command to their own classes.
This will allow for commands to be reused with new parameters (without
affecting existing usages), and also
easier unit testing as we can control which parameter to add (instead of
having to set up the entire
RepoConfiguration
).The text was updated successfully, but these errors were encountered: