-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fixes #178 #182
Fixes #178 #182
Conversation
|
||
import org.eclipse.microprofile.config.spi.ConfigSource; | ||
|
||
public abstract class AbstractConfigSource implements ConfigSource, Serializable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a serialVersionUID
.
implementation/src/main/java/io/smallrye/config/AbstractConfigSource.java
Outdated
Show resolved
Hide resolved
This morning I realized I messed up and we do need the parent separate.
If we don’t, any config source artifact requires the full implementation, which negates the benefit of config sources being separate as they then can’t be used in other implementations
…Sent from my iPhone
On Nov 8, 2019, at 16:37, David M. Lloyd ***@***.***> wrote:
@dmlloyd commented on this pull request.
In implementation/src/main/java/io/smallrye/config/AbstractConfigSource.java:
> @@ -0,0 +1,33 @@
+package io.smallrye.config;
+
+import java.io.Serializable;
+
+import org.eclipse.microprofile.config.spi.ConfigSource;
+
+public abstract class AbstractConfigSource implements ConfigSource, Serializable {
+ private int ordinal;
Making ordinal mutable could cause trouble. It should be final. That does raise a challenge however for config sources which configure their ordinal from their own data (is that all of them?); it might be worth introducing an intermediate class or classes to support this (e.g. a MapBasedConfigSource which accepts a Map parameter could call super(name, Integer.parseInt(map.getOrDefault(...)); and the properties config source could call e.g. super(propertiesToMap(properties)) or some such).
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ah I didn't realize that it was a goal to be able to use these config sources with other implementations. Even the default ones? |
TBH I'm not sure this is a worthwhile goal. Does it really make sense? What is an example use case? |
It's just the parents that would need to be extracted actually. The default ones can still be inside the main impl. It's a two-part goal. One is because that was the goal of MP Extensions, which we're accepting a donation from, and two it would help drive usage and adoption of SmallRye, possibly with a view to users/implementors switching to the full config impl at some point |
Okay so then I guess the strategy could be:
|
That's a good explanation of what I was thinking, thanks |
👍 Sorry for being dense! |
To be fair, I wasn't really explaining what I was thinking. So the clarification was good for both of us |
Ok, think we're on the right track now |
common/src/main/java/io/smallrye/config/utils/ConfigSourceUtil.java
Outdated
Show resolved
Hide resolved
Thanks @dmlloyd. Do you think this warrants a bump to 1.4.x? |
Yes I think that's reasonable. There are now two artifacts to dependency-manage which is a pretty substantial change. |
No description provided.