-
Notifications
You must be signed in to change notification settings - Fork 0
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
Avoiding Random Constants Everywhere. Configurable ROV #270
Labels
Milestone
Comments
I'm thinking having defaults could make things more complicated like you're saying. It turns into managing two separate config files, your config and the default. Maybe we can do without the defaults for version 1.0 or even version 0.1 and assess if there's a case for it. This looks like it could be a big win though |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now we have a lot of statically defined constants for our various classes. We also have three other ways that we get configuration properties. There's the
org.apache.commons.cli
Option.builder
that we see in the main methods, thejava.lang
System.getProperty
we see throughout the code, and there'sjava.util.prefs
Preferences
for persistent data... Gross. mucho dislike.I asked a question here about configuration and got a reasonable response. The suggestion was to do away with all these different methods and use a single concept for configuration. And also to make absolutely all static constants configurable (apart from values in test code; this is for main application code only)
What libs do we use?
I've been looking up some libraries, and it seems that Commons Configuration Library could be a good choice.
How do we synchronize configs across all devices?
I think we could make a script, similar to the shutdown/ restart scripts, that logs into each device, updates the config file, and restarts the control software. This way we only need to edit the file on topsides and then push it to the Rasprime/ PiCameras.
How do we use a config to save objects?
It wouldn't be too hard to write a wrapper around the commons-configuration lib that turned objects into json and put them into a
.properties
file. We could then do away with the ResetGUI program and just remove lines from our.properties
Do we keep default values and make configuration optional?
If yes do we continue to try and make defaults up to date? Seems counter-intuitive..
If yes should we only keep default values to allow tests to pass?
If no do we create a separate configuration file for tests?
Where do we store configuration files?
We can keep the most updated one on github. The user can then edit a file which overwrites values in this default config.
Should we allow for multiple configuration files?
If so we need to know how to load one specifically without modifying the other; and worry about applying critical configs (like motor/ thruster addresses) to everyones config. Would probably be better to avoid this for a version one.
The text was updated successfully, but these errors were encountered: