How to handle injecting dependencies into rich domain models?
- by Arne
In a web server project with a rich domain model (application logic is in the model, not in the services) how do you handle injecting the dependencies into the model objects? What are your experiences?
Do you use some form of AOP? Like Springs @Configurable annotation? Load time or build time weawing? Problems you encountered?
Do you use manual injection? Then how do you handle different instantiation scenarios (creating of the objects through an library [like Hibernate], creating objects with "new" ...)?
Or do you use some other way of injecting the dependencies?