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

CommandRunner: apply separation of concern #310

Open
yamidark opened this issue Aug 19, 2018 · 3 comments
Open

CommandRunner: apply separation of concern #310

yamidark opened this issue Aug 19, 2018 · 3 comments

Comments

@yamidark
Copy link
Contributor

yamidark commented Aug 19, 2018

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).

@yamidark
Copy link
Contributor Author

@damithc @eugenepeh your opinion on this?

@eugenepeh
Copy link
Member

Sounds good to me.

@yamidark yamidark self-assigned this Aug 29, 2018
@eugenepeh
Copy link
Member

part of #442

@yamidark yamidark removed their assignment Dec 20, 2018
eugenepeh added a commit that referenced this issue Dec 22, 2018
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.
@dcshzj dcshzj moved this to For existing developers in RepoSense Roadmap Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: For developers
Development

No branches or pull requests

2 participants