This link has been bookmarked by 39 people . It was first bookmarked on 02 Jul 2006, by Raghu Rajagopalan.
-
11 Oct 12
-
03 Jun 12
-
02 Jun 11
-
04 Mar 11
-
09 Jan 11
-
07 Dec 10
-
07 Sep 10
-
16 Aug 10
-
31 May 10
-
15 May 09
-
21 Mar 09
-
04 Feb 09
-
13 Oct 08
-
08 Oct 08
scmoralWhen developing web applications, many people create their data access layer using two basic design patterns(design pattern meaning an informal description, not to be confused with the gang of four). The first is to put the responsibility on the DAO class
-
07 Jul 08
-
01 Jun 08
-
22 Mar 08
-
23 Jun 07
-
09 Mar 07
-
12 Feb 07
-
To make things worse, what if you want to swap out your JDBC DAO classes for ones that use a persistence framework like Hibernate. Hibernate catches my eye because > I immensely dislike writing gobs of SQL. For a Java programmer, Hibernate offers a much more natural way of persisting objects. Instead of writing JDBC code, > hibernate allows me to deal with POJO's and persist them for me. The bulk of my work lies in maintaing OR Mapping files. With hibernate, developers working outside the data access layer > will not know which classes are persisted and which are not since the POJO's do not extend or implement anything. So lets use hibernate in our application them. Unfortunately for us, our make believe application has DataSource's floating around in method signatures. > Since hibernate uses a SessionFactory object instead of a data source, mass code changes will need to be made to make the transition. > Obviously Hibernate knows about data sources under the covers but client code is not aware of that. For those of you thinking of > a "find and replace" engineering solution, I hope I never get the opportunity to work with you :) The find and replace approach is similar > to loosening a rusty bolt with a pair of pliers. It might work once, maybe twice, but over time your bolt's integrity will be compromised and in need of a replacement. > The same is true for your code. It will start to deteriorate over time. I've seen this over and over and over again! > Heck I may have even participated in this kind of macro program >ming in
-
To make things worse, what if you want to swap out your JDBC DAO classes for ones that use a persistence framework like Hibernate. Hibernate catches my eye because I immensely dislike writing gobs of SQL. For a Java programmer, Hibernate offers a much more natural way of persisting objects. Instead of writing JDBC code, hibernate allows me to deal with POJO's and persist them for me. The bulk of my work lies in maintaing OR Mapping files. With hibernate, developers working outside the data access layer will not know which classes are persisted and which are not since the POJO's do not extend or implement anything. So lets use hibernate in our application them. Unfortunately for us, our make believe application has DataSource's floating around in method signatures. Since hibernate uses a SessionFactory object instead of a data source, mass code changes will need to be made to make the transition. Obviously Hibernate knows about data sources under the covers but client code is not aware of that. For those of you thinking of a "find and replace" engineering solution, I hope I never get the opportunity to work with you :) The find and replace approach is similar to loosening a rusty bolt with a pair of pliers. It might work once, maybe twice, but over time your bolt's integrity will be compromised and in need of a replacement. The same is true for your code. It will start to deteriorate over time. I've seen this over and over and over again! Heck I may have even participated in this kind of macro program
-
-
18 Dec 06
-
05 Dec 06
-
30 Mar 06
-
29 Mar 06
-
22 Nov 04
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.