Closed smifun closed 7 years ago
Do you have a specific reason to use IDBI
in your factory method? $IDBI_a3a4209300b4
seems to me as a proxy class generated by a byte-code code generation library. Could you make sure that a DBI
instance registered in the IoC framework you use?
Generally I agree with you that programming with interfaces is a good practice, but I doubt in usefulness of the IDBI
interface. If I'm not mistaken, its origin comes from the times when JDBI was trying to integrate with the Spring Framework 2 and it required registered beans to have interfaces. Outside of Spring, this interface was never adopted and consequently removed in JDBI3.
I changed build method which creates DBI to return DBI instead of IDBI and it works. Didn't expect that it would be that simple. Thanks.
Hi, When using DBIHealthCheck it requires DBI as constructor param which makes it possible to init only in place where DBI is created. When trying to move that to separate method like that
its producing error like this
when I changed param type in buildHealthChecks to DBI I get
IMO solution for this would be to use IDBI in DBIHealthCheck. DBIHealthCheck is only calling open method on DBI which is actually part of IDBI interface. Apart from that it good practice to depend on abstraction rather than implementation.