Using jdk proxies and Kotlin kinda sucks since all checked exceptions are wrapped in
UndeclaredThrowableException
.
What are people doing instead ?
e
elizarov
06/19/2019, 2:29 PM
What are you using proxies for?
s
spand
06/19/2019, 2:41 PM
Variations of logging/monitoring invocation counts, duration and another case with something like:
Copy code
interface LocationFactory<T> {
fun frontpage() : T
fun specificPage(user: User) : T
}
We can then implement it for say
Location
class once and have proxies for other types. I can come up with other ways to somewhat do this without proxies but we do this to optimize the readability at the many call sites of these functions.