Wrapping a repository with a caching wrapper while preserving modularity

16 views
Skip to first unread message

Grzegorz Gurgul

unread,
Apr 4, 2019, 1:54:22 PM4/4/19
to google-guice

Assume we have two classes (real and proxy one) which implement the same interface. One implementation is a proxy which relates operations to the any other wrapped implementation (caching).

I would like to have a module which binds real implementations to the interface so whenever it is installed the application will work. But at the same time I would like to make the application use the cached version if it was installed (and the proxy ones should have the real ones injected).

How to do it with Guice?

Reply all
Reply to author
Forward
0 new messages