-
Notifications
You must be signed in to change notification settings - Fork 3
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
add cache #4
add cache #4
Conversation
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.
Kind of OK by me. See comments.
Thanks @dsyer for the review! |
I can live with it, but I am not a big fan of the
Otherwise looks to to me. |
Thanks @sdeleuze. Yeah, my concerns were that'd it is too easy to create a new cache on each usage. I'm not sure if there is a better design which has a static default and a way to override it. Any typical patterns for this? |
I don't think there is a good "self-contained" way to do that, by design. But I am not sure the situation is different than My recommandation would be to only provide the constructor, without the static field, and document clearly on both Javadoc and README that:
This is also what is done for very popular dependency of the ecosystem like Jackson |
I guess in Java that is the best we can do. :) I'll get those changes done today. |
Changes are in. LMKWYT. Thanks! |
Awesome, looks good to me for the singleton removal. The only remaining ask would be to make |
Cool. I've changed that. And what about:
Should it be |
Indeed it can be static as well. |
@jamesward do you really anticipate that someone would want to use a custom cache implementation with It seems to me that caching can easily be an internal implementation detail, which then removes the need for |
Good point. If the Spring's usage doesn't foresee plugging in a custom cache then we could make it internal. Question on |
There is indeed likely something to refine here.
I created a dedicated new issue, let's maybe continue the discussion there: #8 |
Note that I wanted to preserve a way to use the locator statically so there is now a
WebJarVersionLocator.DEFAULT
for that.