Spring, and Guise will be all right. I personally prefer Guice for a clean dependency injection, but Spring offers a lot more.
The code will look something like this:
public class AnimationCacheClient { private AnimationCache cache; @Autowired
I personally prefer constructor injection, but you can also use installer injection or field injection.
Note that the purpose of DI is not to have “simple singletones”. Its main purpose is to make the code ( AnimationCacheClient here) easily unit-estable, being able to introduce mock dependencies (here, the AnimationCache layout).
source share