0

I am working on a project, we have used interfaces in dao layer so that we can change hibernate or jdbc depending upon client requirement ! but we can use abstract class to achieve the same so why we need to use interface only ???

rockey 123
  • 125
  • 1
  • 2
  • 6
  • 3
    "we have used interfaces" maybe you should ask "we" why –  Feb 14 '15 at 07:49
  • Also, if the whole point of using interfaces is to be able to switch from hibernate to JDBC, that won't happen. And if it happens, the interfaces won't help much, because JDBC and Hibernate have completely different semantics: hibernate returns attached objects, that you can change and have their new state automatically made persistent. JDBC doesn't have that. – JB Nizet Feb 14 '15 at 08:04

0 Answers0