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
introduces under_score notation for all properties, fixes #682 #719
Conversation
It appears we cannot avoid the backwards compatibility break (some will complain), but it's for better library organization. |
My suggestion is to group all these fixed strings into a central public class e.g.
|
Not sure about this constant class as this tightly coupling is only possible if used from a java client (also probably the name should be Renaming of those keys should not happen often as this breaks usage from 'outside'. Or would a more context specific solution like currently done very seldom for e.g. If not context sensitive the name would be ugly long like |
Yes that could work too. |
What came to my mind is to use embedded classes: public class Parameters {
public static class Algorithms {
public static String DIJKSTRA="dijkstra";
}
} Then one could import e.g. Parameters.Algorithms and just use |
I'd vote for that, good organization. |
The advantage of having all in one place is also a good overview / documentation of features. |
Please see this new class 9fa4441#diff-c6031a04cf6bb054003314f01e9a4239R24 Maybe we should improve the handling for "on query parameters" vs. "init parameters". E.g. To help migration we could throw an exception (can be disabled) if parameters are passed to GH on init and are not listed in the |
Nice, I like the constants synthesis in the class too. |
Yes, although these should be only "init parameters" (should we move them there too?) or 'private' parameters (I would keep them private as there are e.g. implementation specific) |
Inner classes can work, unless we have at the end a big amount of strings to handle.
e.g. how you put the graph properties? |
Yeah, I'm not sure if some of the properties should be moved e.g. into the algorithms.
I more meant params like |
Probably a separate issue about hosting all fixed strings - regardless category - in such class(es) would be best and keep this for the notation? |
This is merged now. |
Another thought, do you think the strings should be sorted in the class for better reviewing? |
Do you mean the Parameters class and what do you mean with better reviewing? |
Yes in that. Like you mentioned above it's a good overview / documentation of features. So I'm wondering if the various properties should be better sorted alphabetically in each sub-class, e.g. here. |
Ah, yes. Makes sense for the future, also for the static classes. For now the setting number is small enough also hopefully we can create enough static classes to keep the number small. |
updated config example related to #719
This change fixes #682 and requires a re-import as not only the storable properties are changed but also the EncodingManager properties like turnCosts -> turn_costs
Done:
Some backward breaking changes (no fallback for now):
assertEquals("valueA", subject.get("FOO", ""));
. The reason is that camelCase still works and is automatically converted to under_scoreTODOs:
routing.roundTrip.maxRetries