java - Difference between singleton and eagersingleton for Gin or Guice? -
i wondering different between singleton , eagersingleton gin or guice?
from guice's wiki
eager singletons reveal initialization problems sooner, , ensure end-users consistent, snappy experience. lazy singletons enable faster edit-compile-run development cycle. use stage enum specify strategy should used.
- eager: "create instance of class when module being run"
- lazy: "create instance of class when it's first requested dependency injection"
Comments
Post a Comment