| |
Struts Tutorials:
Struts2 Tag CheckBoxList , Checkbox, Iterator, IF
Struts2 Tag Library Example
Struts2 Tiles Example
Struts2 Tiles I18N Example
Struts2 Questions
Struts Tiles I18N Example
Struts Eclipse MVC
Struts2 Tags
Struts2 Example and Tutorial
Struts MVC
Struts2 Validation
Hibernate Tutorials:
Hibernate Case Study
Class Hierarchy Persist Example
Using Hibernate Interceptor
Hibernate Questions with Answer
Hibernate Many-to-Many Mapping Example
Hibernate one-to-many Mapping Example
Hibernate and ORM tools
Spring Hibernate Example
Hibernate SessionFactory Example
Hibernate Mapping Class Hierarchy
Hibernate Questions
Hibernate SessionFactory Questions
Spring Hibernate Example:
Spring Hibernate Case Study
Written By : Amit
Title :
Hiberate Spring Tutorial
Description :
Example code More...
|
Written By : Amit
Title :
Hibernate SessionFactory
Description :
Example code More...
|
Written By : ISHTEK
Title :
Design Spring Hibernate
Description :
Example Case study More...
|
Written By : Amit
Title :
Hiberate DAOSupport
Description :
Hiberate Template More...
|
Written By : Amit
Title :
HiberateDAOSupport Example
Description :
Design discussion More...
|
| Tags/Keywords : Spring Hibernate Example,TutorialHibernate-SessionFactory,Example-code Author : Amit Date (Year/Month/Date): 2009-03-31
Hibernate SessionFactory Example Strategy
Task is to come up with an approach for designing application that should be
practically kept away from code change in case there is only shift in Persistence
tools/Framework, like from Hibernate to JDBC or to JPA or to TopLink etc.
But basic core functionality like create, update, delete etc remains the same.
One approach for getting appropriate Bean lookup strategy while using Spring Framework
is as follows:
1. Define an interface with all the basic operation those are desired from Persistence layer
like create, update, delete, query, queryAll, deleteAll etc etc. with appropriate
arguments and return types.
2. Define a Factory pattern style Factory for accepting a variable argument and
return implementation of the interface (discussed in point 1)
3. Factory with the interface is to be configured in Spring Framework configuration.
4. Depending on the input value to the Factory, there could be concrete subclass of
HibernateDaoSupport, JdbcDaoSupport, JdoDaoSupport, JpaDaoSupport, TopLinkDaoSupport
and many more.
5. Appropriate templates are to be instantiated and supplied to the application
specific concrete classes of the DaoSupport. Like for HibernateDaoSupport the template
class will be HibernateTemplate, for JdbcDaoSupport it will be JdbcTemplate, etc.
6. Whenever there is any change in the persistence strategy of application, then
there will be minimal changes in the Spring configuration file for providing
appropriate DAO support to the Factory, that is to be used by the common interface
exposed to the application. Without really any change in class file, so not even
compilation or build required.
Based on this approach I shall be somming up with some sort of prototype and
example application to test this prototype before sharing it on this site.
Please do share your thought on this and jointly let us improve this design to
fulfill desired objective/Task.
| |
|
| Are you interested in solving a very interesting Technology Stack while Playing this Game 
|
|
| Home >>> Spring Hibernate Example >>> Hibernate SessionFactory >>> Example code |
|
|
Visitor/User referred related external URL:
(Visible upon review and approved by this site Administrator)
|
|
|
|
|
<- requires login | Log in or Register | |
Copyright © 2008-2009, Interview-Questions-Tips-Forum, All Rights Reserved. | CONTACT PRIVACY POLICY DISCLAIMER |
 |
Terms of Use and Disclaimer :
This web site provides some of the information about various technologies, example
code, tips, tutorials etc. Like any printed materials, content of these pages may
become out of date over a period of time. Therefore all visitor/users of this web
site are requested/advised to refer to the originating parties/sources for the
latest changes and happenings for detailed information. This information is not
intended to be a substitute for the original reference provided by the originating
parties/sources.
By accessing and using this website in any ways, including, without
limitation, browsing the website pages, using any information, using any content and/or
downloading any materials, you agree to and are bound by the terms of use
described in this page and Usage Terms and Conditions.
If you do not agree to all of
the terms and conditions contained in the terms of use described in this
page and Usage Terms and Conditions, do not use this
website in any manner. If you are using the website on behalf of your
employer, you represent that you are authorized to accept these Terms of Use
on your employer's behalf.
All Trademarks are property of their respective owner. Appropriate measure is being
taken for providing accurate and up-to-date information but like any printed materials,
these blog(s)/contents may eventually be outdated one day, so if you are using any
of these information, please refer original content/documentation from respective sources.
And under no circumstances shall the Author of these contents and/or this web site
be liable for any loss, damage, expense incurred or suffered which is claimed to have
occurred because of usage of the contents of this web site.
If you have any questions/queries/feedback/suggestions then please write to this web
site owner at contact.
|  |
|
|
|
|
|