Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/articles/java-tutorials/)
-   -   Name of classes provide implementations of Hibernate interfaces? (http://www.go4expert.com/articles/classes-provide-implementations-t4562/)

abhishekshahi 5Jun2007 17:05

Name of classes provide implementations of Hibernate interfaces?
 
1 Attachment(s)
People generally have doubt that when we use Hibernate we simply use configuration to create SessionFactory(). Using that we create session for JDBC connection. But all these SessionFactory and Session class are interfaces. But there is no class available with this name which implements methods of this class.

Hibernate interfaces Session,SessionFactory,Transaction etc. are implementation of factory Pattern.i.e. We simply request for an object and its implementation class returns required object.

a Hierarchy could be like this,

net.sf.hibernate.Configuration class --> requests for --> net.sf.hibernate.SessionFactory interface --> which inturn builds a SessionFactory using --> net.sf.hibernate.impl.SessionFactoryImpl class


Refer: (For factory Pattern) http://gsraj.tripod.com/design/creat...y/factory.html
Refer: (For control flow) Code attached

shabbir 5Jun2007 18:02

Re: Name of classes provide implementations of Hibernate interfaces?
 
These days I have been doing some factory patterns and I think you can also refer to

http://msdn2.microsoft.com/en-us/library/ms954600.aspx


All times are GMT +5.5. The time now is 00:01.