top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Which design patterns are used in Hibernate framework?

0 votes
1,146 views
Which design patterns are used in Hibernate framework?
posted Apr 28, 2016 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

0 votes

Some of the design patterns used in Hibernate Framework are:

Domain Model Pattern – An object model of the domain that incorporates both behavior and data.

Data Mapper – A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Proxy Pattern for lazy loading-Proxy Design pattern is one of the Structural design pattern and in my opinion one of the simplest pattern to understand. Proxy pattern intent according to GoF is:

Provide a surrogate or placeholder for another object to control access to it.

The definition itself is very clear and proxy pattern is used when we want to provide controlled access of a functionality. Let’s say we have a class that can run some command on the system. Now if we are using it, its fine but if we want to give this program to a client application, it can have severe issues because client program can issue command to delete some system files or change some settings that you don’t want.

Factory pattern in SessionFactory-Factory Pattern is one of the Creational Design pattern and it’s widely used in JDK as well as frameworks like Spring and Struts.

Factory design pattern is used when we have a super class with multiple sub-classes and based on input, we need to return one of the sub-class. This pattern take out the responsibility of instantiation of a class from client program to the factory class.

answer Apr 30, 2016 by Devendra Bohre
0 votes

Some of the design patterns used in Hibernate Framework are:

Domain Model Pattern – An object model of the domain that incorporates both behavior and data.

Data Mapper – A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Proxy Pattern for lazy loading

Factory pattern in SessionFactory

answer May 2, 2016 by Karthick.c
...