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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -