Re: How do I use static factory method instead of constructor?

2015-04-12 Thread Stephan Classen
I see two ways to achieve the same using no static factory methods. 1. As Ben already suggested, create a provider. You can even call a static factory method from the provider. Or you can inline the static factory method if it is only called from the provider. Bu

Re: How do I use static factory method instead of constructor?

2015-04-12 Thread John Calcote
The most significant benefit of this pattern is one which is much more obvious outside the scope of guice, and one which is used all the time. For instance, have you ever tried to design a class that runs itself (a run method) within a thread? It's nice when you create one of these objects to h