vsch/kotlin-jdbc

Make Session an interface for easy decoration

Closed this issue · 3 comments

I have ran into a situation when I need to do two things:

  1. Log all queries - for debug;
  2. Make queries frequency report - for throughput monitoring, queries per second.

The most straightforward way to implement his would be to wrap the Session object into a decorator. In order to use Kotlin decoration syntax, both the original Session class and the decorator need to implement the same interface.

vsch commented

@root-talis, good idea.

  • Fix: factor out Session and Transaction functions into interfaces. Implementation renamed
    to SessionImpl and TransactionImpl

I will be making a release 0.4.2 with these changes.

vsch commented

@root-talis, repo updated. Maven update done but will take some time to propagate.

Thanks for the update! Works like a charm :)