kennknowles commented on code in PR #37631:
URL: https://github.com/apache/beam/pull/37631#discussion_r2942100572


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/ModelCoderRegistrar.java:
##########


Review Comment:
   I think you understand it. It is a good point between pinning the behavior 
between when a CoderTranslator is constructed vs when it is translating. From a 
higher level, these happen in more or less the same moment in the pipeline's 
lifecycle, so it is more about factoring the responsibility - who is 
responsible for reacting to a change in pipeline options? My preference is that 
the CoderTranslator is straightforward, while the thing vending a 
CoderTranslator reacts to options. This is to push the flag-driven conditional 
around as large a block of code as possible, so primary logic can have as few 
conditionals as possible to keep control flow as easy to read as possible.
   
   Rather than a linear scan, the `@AutoService` bits can still register 
themselves into a map, only I guess instead of a map from class to 
CoderTranslator it might be a map from Class to CoderSupplier or some such.



-- 
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