nUserDao userDao;
n...
npublic void setUserDao( UserDao userDao) {
n this.userDao = userDao;
n}
nNo more dependency on a specific implementation of the DAO. But
who will call the setter?
n
nInversion of Control
(IoC)
nThe
application code is no longer responsible for instantiate an interface with a specific implementation, A.K.A. Dependency Injection