tags:

views:

21

answers:

1

Why the examples about hibernate use SessionFactory interface instead SessionFactoryImpl class to open a session on the given connection?

+1  A: 

The implementation could change? In general, if you can use an interface to interact with an object, you should. Interfaces are less likely to change than classes, so if a class conforms to the interface, always reference it BY the interface. This is pretty standard OOP practice.

Stefan Kendall