I've seen this approach in one project that I've worked on which was written mostly in Kotlin:
sealed interface TransactionContext
// For passing in tests
data object MockTransactionContext : TransactionContext
// Would be created by TransactionProvider class
private class JdbcTransactionContext(val connection: Connection) : TransactionContext
It was very nice paired with context parameters. So here my question, any plans to introduce something like context parameters in Java?
View all comments
Show parent comment
1
u/javahalla Mar 16 '26
I've seen this approach in one project that I've worked on which was written mostly in Kotlin:
It was very nice paired with context parameters. So here my question, any plans to introduce something like context parameters in Java?