I am reading the Spring Hibernate CRUD tutorial from this url
http://viralpatel.net/blogs/spring3-mvc-hibernate-maven-tutorial-eclipse-example/
Please can anyone tell me why in ContactController.java
, ContactService
interface is autowired instead of the class ContactServiceImpl
.
Similarly in ContactServiceImpl
ContactDAO
interface is injected. Shouldn't we supposed to inject class instead of an interface?