Move default device parameters from DeviceFactory to the respective devices #1257 #1259
Move default device parameters from DeviceFactory to the respective devices #1257 #1259
Conversation
|
SonarCloud Quality Gate failed.
|
| 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"; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.










No description provided.