Re: DAO pattern

2008-02-04 Thread Manos Batsis
Zhang, Larry (L.) wrote: I have a user object whose data is from three resources: Db2, LDAP, and other flat file. Per dao pattern, do you think I should have three daos or one dao to encapsulate the data access implications? Depends on what is easier for you. This will not effect your code if

[OT] Re: DAO pattern

2008-02-04 Thread Antonio Petrelli
2008/2/4, Zhang, Larry (L.) <[EMAIL PROTECTED]>: > Sorry if this is not too on topic. > > I have a user object whose data is from three resources: Db2, LDAP, and > other flat file. Per dao pattern, do you think I should have three daos > or one dao to encapsulate the data acc

DAO pattern

2008-02-04 Thread Zhang, Larry (L.)
Sorry if this is not too on topic. I have a user object whose data is from three resources: Db2, LDAP, and other flat file. Per dao pattern, do you think I should have three daos or one dao to encapsulate the data access implications

Re: getDataSource, DAO pattern, and Struts

2006-09-12 Thread Angelo zerr
Hello Darren, I'm aggree with Larry. If you want you can see Architecture shema with Service/DAO pattern in my open source project Gestcv at http://gestcv.sourceforge.net/fr/architecture.html (sorry it's in frensh). You can download the application WEB to see how I use Spring w

Re: getDataSource, DAO pattern, and Struts

2006-09-11 Thread Larry Meadors
On 9/11/06, Darren Hall <[EMAIL PROTECTED]> wrote: So, should I use the datasource functionality provided in struts, or should I "roll my own" database connection solution by creating a datasource factory that can be used to retrieve connections? I wouldn't do either. If you can, use Spring to

getDataSource, DAO pattern, and Struts

2006-09-11 Thread Darren Hall
quick question. I'm using struts 1.2.9 and I need to implement a database connection for my web application and wanted to use a standard DAO pattern (this is due to the fact that I will be using connection pooling as well as other datastores to store application data, and want to decoupl

Re: [OT] DAO Pattern in Struts

2005-08-24 Thread Larry Meadors
different underlying API using a single consistent data access API. Interestingly, the JDBC API is another application of the DAO pattern. In that realm, you have a set of interfaces, and database vendors implement them in a way that makes it possible to use them interchangeably – for the most part

Re: [OT] DAO Pattern in Struts

2005-08-24 Thread Emmanouil Batsis
Larry Meadors wrote: You can (and should) use the DAO pattern with Hibernate, too. So true, plus a good DAO interface can decouple your database access implementation and the rest of your app, so that you can switch from hibernate to ibatis or plain jdbc or whatever without having to make

Re: [OT] DAO Pattern in Struts

2005-08-24 Thread Rokibul Islam Khan
Whats about a thread local variable to store the connection instead of as instance variable ? On 8/24/05, Gareth Evans <[EMAIL PROTECTED]> wrote: > Hi Paul, > > How about using a DBCP, that way the connections are always there, a getting > a connection each time > you need to do a unit of work b

Re: [OT] DAO Pattern in Struts

2005-08-24 Thread Gareth Evans
Hi Paul, How about using a DBCP, that way the connections are always there, a getting a connection each time you need to do a unit of work becomes less of an overhead. With dbcp you can create your connection by using an xml file usually named 'something.jocl', drop this into you classpath an

Re: [OT] DAO Pattern in Struts

2005-08-23 Thread Larry Meadors
You can (and should) use the DAO pattern with Hibernate, too. The iBATIS DAO even has built-in support for hibernate (of course, it has support for sql maps, too). Larry On 8/23/05, Paul Benedict <[EMAIL PROTECTED]> wrote: > Erik, > > Oh, I have worked on a project whe

Re: [OT] DAO Pattern in Struts

2005-08-23 Thread Paul Benedict
Erik, Oh, I have worked on a project where that was the pattern I designed for myself!! One accepted a connection for transactions, the other for self-contained singleton executions. Yup, it's a great pattern. You raise an interesting point. I never thought about using a middle-man between my bus

Re: [OT] DAO Pattern in Struts

2005-08-23 Thread erikweber
Original Message- From: Paul Benedict <[EMAIL PROTECTED]> Sent: Aug 23, 2005 6:35 PM To: user@struts.apache.org Subject: [OT] DAO Pattern in Struts Guys, This is off-topic but I need your help. There are some good programmers here and I would like to receive some advice back. I a

Re: [OT] DAO Pattern in Struts

2005-08-23 Thread Larry Meadors
Have you looked at using something like the iBATIS DAO? I think it could save you alot of pain. One thing to watch out for is thread safety - putting a connection on an instance (especially a shared instance) is pretty risky, especially when you start thinking about transactions and the like...th

[OT] DAO Pattern in Struts

2005-08-23 Thread Paul Benedict
Guys, This is off-topic but I need your help. There are some good programmers here and I would like to receive some advice back. I am sure there's a simple answer to it. My Struts app is a multitier app (Web -> Business -> DAO) and it uses Jakarta Commons DbUtils for the DAO layer. My DAO methods

Re: [OT] Request for comments on DAO pattern implementation

2004-10-09 Thread Michael McGrady
Not sure why, but I have never had the difficulty of maintenance being held up because of appropriate uses of interfaces. I have had the opposite happen lots of times. I am a stickler for the interface approach to most classes. I am even thinking of foregoing entirely the use of the System c

Re: [OT] Request for comments on DAO pattern implementation

2004-10-09 Thread Rick Reumann
Adam Hardy wrote the following on 10/9/2004 7:34 AM: However I have never come across a situation where anybody has changed the implementation when doing an upgrade to their application. It sounds good, but IMHO, never happens. Would be interested to find out otherwise :) All of my classes implem

Re: [OT] Request for comments on DAO pattern implementation

2004-10-09 Thread Adam Hardy
for comments on DAO pattern implementation Dear all, I've contemplated two ways of implementing DAO pattern; and I'm unable to decide which is better :) Any comments on pros and cons of these two approaches will be greatly appericiated. Implementation 1: Have IDAO interface and let all t

RE: [OT] Request for comments on DAO pattern implementation

2004-10-08 Thread Freddy Villalba A.
nsaje original- De: Marco Mistroni [mailto:[EMAIL PROTECTED] Enviado el: viernes, 08 de octubre de 2004 16:21 Para: 'Struts Users Mailing List'; 'atta-ur rehman' Asunto: RE: [OT] Request for comments on DAO pattern implementation Hello, My 2 cents.. go for the inter

RE: [OT] Request for comments on DAO pattern implementation

2004-10-08 Thread Marco Mistroni
Subject: [OT] Request for comments on DAO pattern implementation Dear all, I've contemplated two ways of implementing DAO pattern; and I'm unable to decide which is better :) Any comments on pros and cons of these two approaches will be greatly appericiated. Implementation 1: Have IDAO

[OT] Request for comments on DAO pattern implementation

2004-10-08 Thread atta-ur rehman
Dear all, I've contemplated two ways of implementing DAO pattern; and I'm unable to decide which is better :) Any comments on pros and cons of these two approaches will be greatly appericiated. Implementation 1: Have IDAO interface and let all the DAO objects implement this inter