Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Don't dive into the code without reading this description and understanding it, or without reading and understanding the javadocs.
This pull request is number two of three mutually exclusive options. It sketches a "loader" API for loading configuration-related objects in some vague unspecified manner. This pull request is named Option 2. You may also be interested in Option 1 (#131) and Option 3 (#133).
Sample usage:
In as many cases as I could, I asked for and incorporated some group opinions while working this sketch up. See for example #75, #109, #110, #119, #122 (particularly my comment and Roberto's response), #124, and #127, among others.
Option 2 (this PR) differs from Option 1 (#131) primarily by modeling the "loader API" with an explicit
Request
object as its sole parameter. This provides a place where evolution of what it means to request an object can proceed with minimal damage to the actual loader API itself (theRequest
interface changes, theload
method does not). TheRequest
comes with an associatedBuilder
; I've sketched one or two additional qualifiers to show what "extra" information might look like. (If you're honed in on the details, you're reading too closely as it is way too early for that kind of thing.)In Option 2 (this PR), as in Option 1 (#131), the
Loader
returns the loaded object directly. Following the group consensus arrived at in #119 (see Dmitry's comment in particular), whether or not the return value is determinate is deliberately left unspecified.I personally prefer Option 3 (#133) which, IMHO, allows for more graceful API evolution over time.
Finally, and perhaps most importantly, I still think it is far too early for PRs and I would prefer to write documents first, but to date that has not met with success. Therefore I hope this (and the other options) will at least get the discussion going.
Signed-off-by: Laird Nelson ljnelson@gmail.com