Usage patterns/use cases for DI or when to start using it

Posted by Fabian on Stack Overflow See other posts from Stack Overflow or by Fabian
Published on 2010-06-17T23:49:51Z Indexed on 2010/06/17 23:53 UTC
Read the original article Hit count: 172

I'm not sure for which use cases one should to use DI in the application. I know that injecting services like PlaceService or CalculationService etc fits very well but should I also create my domain objects with DI like a User? What is if the User has only one constructor which requires a first and lastname. Is this solveable with DI?

Should I use DI to create the instances for Set/List interfaces or is this pure overkill?

I use guice primarily.

© Stack Overflow or respective owner

Related posts about dependency-injection

Related posts about domain-object