julianhyde commented on code in PR #3084:
URL: https://github.com/apache/calcite/pull/3084#discussion_r1120701334


##########
core/src/main/java/org/apache/calcite/jdbc/Driver.java:
##########
@@ -64,6 +64,15 @@ public Driver() {
     this.prepareFactory = createPrepareFactory();
   }
 
+  private Driver(Function0<CalcitePrepare> prepareFactory) {

Review Comment:
   You're right there's a problem. The problem is that the constructor calls 
`createPrepareFactory()` - an instance method - before the constructor is 
complete, and that's a code smell, because it doesn't allow the class to be 
subclassed cleanly.
   
   Is there a way to change the design of `Driver` so that it doesn't have that 
code smell?
   
   I like the idea of adding `Driver 
withPrepareFactory(Supplier<CalcitePrepare>)` so that people don't have to 
subclass Driver. But we have to do so compatibly. 



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