nUser instructor = userDao.getUserById( instructorId ) );
nSection section = sectionDao.getSectionById( sectionId );
nsection.addInstructor( instructor );
nsectionDao.saveSection( section );
n
nAdvantages
of DAO
nProvide
a data access API that is
nIndependent
of persistent storage types, e.g. relational DB, OODB, XML flat files etc.
nIndependent of persistent storage implementations, e.g. MySQL, PostgreSQL, Oracle etc.
nIndependent
of data access
nimplementations,
e.g. JDBC, Hibernate, JDO, etc.