Skip to content

Move default device parameters from DeviceFactory to the respective devices #1257 #1259

Merged
uweseimet merged 3 commits intodevelopfrom
issue_1257
Oct 30, 2023
Merged

Move default device parameters from DeviceFactory to the respective devices #1257 #1259
uweseimet merged 3 commits intodevelopfrom
issue_1257

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

No description provided.

@uweseimet uweseimet marked this pull request as ready for review October 22, 2023 09:47
@uweseimet uweseimet requested a review from dialtr October 22, 2023 09:47
@sonarqubecloud
Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

52.9% 52.9% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Comment on lines -34 to -38
default_params[SCBR]["interface"] = interfaces;
default_params[SCBR]["inet"] = DEFAULT_IP;
default_params[SCDP]["interface"] = interfaces;
default_params[SCDP]["inet"] = DEFAULT_IP;
default_params[SCLP]["cmd"] = "lp -oraw %f";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a drawback with this change in that the various default parameters get fragmented, making it harder to get an overview of default parameters by reading the code.

I understand the goal of decoupling these parts of the code. It's tradeoff that I can accept.

Copy link
Copy Markdown
Contributor Author

@uweseimet uweseimet Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know what you mean, but the device-specific code should be coded in the respective device for better encapsulation.
Without knowing the previous code you might not even expect these data to be in the factory. These are device-specific data, so that natural location of the code should be the device, if you are looking for device characteristics.
Currently some code locations need the device factory to get device-specific data, even though the actual device is already known at these locations. This shows that something was not quite right.

@uweseimet uweseimet merged commit c78ba80 into develop Oct 30, 2023
@uweseimet uweseimet deleted the issue_1257 branch October 30, 2023 10:24
uweseimet added a commit that referenced this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move default device parameters from DeviceFactory to the respective devices

2 participants