This is Antoine Willy's Typepad Profile.
Join Typepad and start following Antoine Willy's activity
Join Now!
Already a member? Sign In
Antoine Willy
Recent Activity
I think setter injection is a bad idea, and should be reserved to optional things. I perfer use constructor injection, this increase the object stability => it can not be created without required dependencies. If you use setter with spring it is better to create an init method to verify object state. The service constructor must use the interface of the DAO, and not the implementation. Further the more if you use constructor injection, you never see setters in the service interface. Best regards Willy Once this is done, for unit testing, you just need to test the fonctionnalities of the service implementation, not the dependencies integration => integration tests. You can simulate the dao behaviour with one mocking framework like Mockito, which have a DSL, and is easy to use (but not well documented)
Antoine Willy is now following The Typepad Team
Mar 17, 2011