azagrebin commented on pull request #12446:
URL: https://github.com/apache/flink/pull/12446#issuecomment-637634003


   About the approaches:
   
   - **The inheritance approach** looks simple and reliable but ugly from 
oop/maintenance perspective but acceptable if there is no better idea
   
   - **The decorator approach** is much nicer for oop/maintenance but 
questionable, as java `ClassLoader` does not have interface and it is not quite 
extension-friendly. I tried to analyze all the public methods which need 
forwarding.
     - some public methods are even final, so no way to forward
     - there is a family of some assertion methods but they seem to be an 
unrelated concern
     - also the actual class loader associated with the class will be the inner 
class loader, not the thread’s context class loader, not sure how big problem 
it is though
   
   So far, I have not really found any other problems with the decorator 
approach. I tend to use the decorator approach but it is somewhat fragile imo.


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

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


Reply via email to