Re: Can DI be used for Instantiating Value Objects

2012-05-11 Thread jordi
In case you really need to inject value classes, Guice does that for you for free. If you @Inject a Person (non-scoped), every time will give a new Person. But I can't figure out why a simple value class should be managed by Guice. In this case I'm sure that's easier and clearer to just use a

Re: Can DI be used for Instantiating Value Objects

2012-05-11 Thread Christian Edward Gruber
Please don't inject value classes, generally speaking. I tend to think of dependencies in three kinds - collaborators, configuration, and consumables. Consumables are value classes that are consumed by and transformed by your collaborators, in the context of your configuration. Generally