A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
  • Newsletters

singleton

A collection of 1 posts
Java

True singletons with Dagger 2

I’ve written some time ago about Dagger 2. However, I still don’t understand every nook and cranny. In particular, the @Singleton annotation can be quite misleading as user Zhuiden was kind enough to point out: If you create a new ApplicationComponent each time you inject, you will get a new instance in every place where you inject; and you will not actually have singletons where you expect singletons.

Sep 6, 2015
A Java geek © 2008-2026
v. 8469dfb85e650fbf59112dd9359084a0b8fa2f6b/13500437904
Latest Posts