The use of Guice shouldn't necessarily warrant any change in your domain model: You may use interfaces if you wish, or you may use concrete classes if you wish.
If you use concrete classes, Guice allows you to make their constructors non-public, which gives you the convenience of referring to an implementation class (in the sense that you don't always need to define an interface), as well as the safety of not allowing folks to instantiate the class directly. Fred On Thu, Aug 18, 2011 at 4:43 PM, Efi Merdler <[email protected]> wrote: > Hello everybody, > > Should I always use interfaces in Guice when binding (using > bind(...).to(...) )? > When should I use concrete classes only binding? > Does it mean that I have a flowed design when not using interfaces ? > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/google-guice?hl=en. > > -- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
