Should Jakarta Config Specify A Programmatic API? #110
Replies: 7 comments 17 replies
-
I see "configuration" {waves hands} as a spectrum (Github will probably make you click on this diagram to zoom in): The Jakarta Config specification can choose to operate anywhere in this spectrum. This discussion asks the question: "Should the specification operate in the yellow/left end of the spectrum?" I think the answer is yes. More details:
So: I personally think this specification does need to define a "skinny" programmatic API (the "yellow" end of the spectrum) that satisfies various goals (to be decided/corralled somewhere else). So yes. |
Beta Was this translation helpful? Give feedback.
-
No. (N.B. I'm understanding "programmatic API" to mean an API responsible for getting "raw" configuration properties, and potentially building up configurations as well. This does not include concepts such as MP Config's converters or configuration sources, which I would think of as "SPI".) Let's examine our use cases, imagining a world without a programmatic API, instead relying on configuration object mapping for user interaction. Users who want to configure their Jakarta applicationsThe user has a single view of what their configuration is. By only allowing users to express their configuration as a bound object graph (aka "configuration object model" or just "object model") which reflects that view - strongly typed, strongly schema'd, we get several benefits:
Implementors of this specificationThe landscape of Jakarta implementations is very diverse today, with different philosophies around program execution and lifecycle as well as deployment and reconfigurability. A programmatic API which works for one vendor is not necessarily going to work for another. I do not believe the currently proposed programmatic API is a clean fit for Quarkus for example. Therefore I do not think it's likely that we would reach anything near a consensus (by vote) on any one programmatic API - and if we did, I think it would likely end up being the most inconsistent, contentious, and problematic aspect of the specification after release. There will almost certainly be vendor-specific APIs for programmatic configuration access. These APIs would commonly be used as the foundation for supporting the production of injectable configuration object models. However, I feel confident in light of the last year's work that the APIs for each vendor implementation may be quite different from one another. Sibling Jakarta specification configuration consumersMost (if not all) of the arguments put forth in the "Users who want to configure their Jakarta applications" heading above will apply here as well, with some additional benefits.
ConclusionMany of these ambitions can only ever be fully realized if configuration has a strict schema-driven underlying document model. Most of these validations can only be achieved if there are no "back doors" to reinterpreting configuration in an ad hoc manner. A programmatic API undermines the potential of this specification and reduces it to little more than shared access to a |
Beta Was this translation helpful? Give feedback.
-
Like the Helidon Config, a programmatic Configuration builder is useful for the case in a Jakarta EE client application. |
Beta Was this translation helpful? Give feedback.
-
My understanding is that there are two understandings of programmatic API features:
If my understanding is correct, I am voting for Option 2 for MVP. |
Beta Was this translation helpful? Give feedback.
-
From our last meeting, there was a general desire to start "doing PRs" in this area. I came up with three mutually exclusive options/suggestions: #131, #132, and #133. I still think it is too early to do this sort of thing but since the consensus was to start writing code early, I guess, I've sketched them out. |
Beta Was this translation helpful? Give feedback.
-
Thanks @ljnelson for doing great job and creating PRs. IMO options 2 and 3 are created more for spec developers (us) convenience than for users. Getting a configuration objects becomes too wordy. Option 1 (#131):
Option 2 (#132):
Option 3 (#133):
I see option 1 as the simplest and the clearest. |
Beta Was this translation helpful? Give feedback.
-
Do we want a programmtic API defined by this spec?
Beta Was this translation helpful? Give feedback.
All reactions