Revision: 175881a92463
Author:   scelfo <[email protected]>
Date:     Mon Jun 23 21:16:56 2014 UTC
Log:      Edited wiki page Scopes through web user interface.
http://code.google.com/p/google-guice/source/detail?r=175881a92463&repo=wiki

Modified:
 /Scopes.wiki

=======================================
--- /Scopes.wiki        Mon Jun 23 21:11:38 2014 UTC
+++ /Scopes.wiki        Mon Jun 23 21:16:56 2014 UTC
@@ -62,7 +62,7 @@
 ==Choosing a scope==
If the object is *stateful*, the scoping should be obvious. Per-application is `@Singleton`, per-request is `@RequestScoped`, etc. If the object is *stateless* and *inexpensive to create*, scoping is unnecessary. Leave the binding unscoped and Guice will create new instances as they're required.

-Singletons are popular in Java applications but they don't provide much value, especially when dependency injection is involved. Although singletons save object creation (and later garbage collection), initialization of the singleton requires synchronization; getting a handle to the initialized singleton instance only requires reading a volatile. Singletons are most useful for: +Singletons are popular in Java applications but they don't provide much value, especially when dependency injection is involved. Although singletons save object creation (and later garbage collection), initialization of the singleton requires synchronization; getting a handle to the single initialized instance only requires reading a volatile. Singletons are most useful for:
   * stateful objects, such as configuration or counters
   * objects that are expensive to construct or lookup
   * objects that tie up resources, such as a database connection pool.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to