luigidemasi commented on PR #27265:
URL: https://github.com/apache/camel/pull/27265#issuecomment-5949478199

   This matches the experience we had with 
[CAMEL-24977](https://issues.apache.org/jira/browse/CAMEL-24977), 
[CAMEL-25049](https://issues.apache.org/jira/browse/CAMEL-25049) and 
[CAMEL-25138](https://issues.apache.org/jira/browse/CAMEL-25138). Evaluation 
and batching already worked across DSLs through the shared semantic language. 
Adding question declarations to Java and XML required separate work on the 
authoring APIs, parsing, metadata and loading behavior, with tests to keep them 
consistent with YAML.
   
   I support having an annotated model in the feature module as the common 
definition. A useful goal would be that adding a question option means defining 
its shape, documentation and default once, with the different DSLs and tooling 
deriving their support from that definition. Generating schemas and catalog 
entries would be a good first step, while keeping shared or generated readers, 
writers and Java builders as the broader direction.
   
   One distinction worth exploring is Java authoring versus parsing existing 
Java source. We could have the fluent Java API build the same declaration model 
used by XML and YAML, while deciding separately how the converter reads that 
Java code.
   
   Our implementation also gives us some useful cases to try against the model: 
named Choice criteria versus ordered Score levels, numeric options containing 
property placeholders, and declarations shared across resources. We ran into 
these during the Java/XML work, so they would help us discover what the model 
and common loading hooks need to express.
   
   Could we use semantic as the first end-to-end example, preserving its 
existing syntax and behavior, and see how much DSL-specific code we can replace 
with the shared model? That would give us a concrete basis for shaping the 
extension mechanism.
   
   _AI-generated by Codex on behalf of 
[luigidemasi](https://github.com/luigidemasi)._
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to