JCommander is great! However, I am stuck with something.
Background: I've got configs all over the place in this project. I've been able to remove a lot of redundant code by making Config classes that are just a set of parameters for Jcommander to populate. All good. But now I am bumping into the situation where these classes need extension or overriding. Example: I have a common config for X which many modules use, but one module needs a parameter of X as REQUIRED.
My options are:
- pretend this parameter means something else and make a new class for it (not nice)
- extend a core class with with the different flavours of the parameters (every param has the same meaning this way, but now there are many files, and much separation for a set of parameters that should be together)
- have a full set of correctly grouped parameters in one class, and have the ability to override them for exceptional circumstances.
Questions: is the third option at all possible? what do you recommend for dealing with this problem?
Please and thank you