-
Notifications
You must be signed in to change notification settings - Fork 49
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
Refactor the Wine Engine Object #1066
Refactor the Wine Engine Object #1066
Conversation
var containerConfiguration = configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); | ||
var architecture = containerConfiguration.readValue("wineArchitecture", "x86"); | ||
const containerConfiguration = this.configFactory.open(this.prefixDirectory() + "/phoenicis.cfg"); | ||
const architecture = containerConfiguration.readValue("wineArchitecture", "x86"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to move the "extraction" of the three value wineArchitecture
, wineDistribution
and wineVersion
to a dedicated method that returns a json containing the three values.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that a json is clearer compared to readValue
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main issue for me is the extraction code and the access to containerConfiguration
which I would like to hide behind a method.
In addition it is quite easy to access the values:
const { architecture, distribution, version } = fetchContainerConfiguration(this.prefixDirectory() + "/phoenicis.cfg");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, the architecture
method already encapsulates this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand? The architecture()
method only returns a single value, while I suggest to return three wine related values at once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know. However, your point is that you want to hide something in a method. In my opinion the architecture()
method already does so. Therefore I do not see the need for additional encapsulation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me demonstrate what I want to do in a different (new) PR. This is out of scope anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
Additionally we should really add some more comments to this class! |
About the Codacy error: I don't want to fix the issue because it seems suspect to me |
You're right about the Codacy error. |
- refactor the wine engine object - add some more error messages
This PR refactors the Wine engine object with newer JS language features like
class
and streams