struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Tataryn" <>
Subject Alternative Datsource Hot-potatoing...
Date Fri, 06 Sep 2002 17:41:26 GMT
I was wondering if someone could give me a heads up on some alternative 
means for which to give my data access layer access to my datasource.

I don't really like the idea of my controller grabbing the Datasource, 
passing it off to my business layer, who in turn passes it along to my data 
layer.  I guess I'm sort of a purest, but I don't think the Business layer 
should know anything about the database, and that means it shouldn't even 
have methods that take connections or datasourses as parameters.

I think the only thing I like about the Controller passing along a 
connection to my business/data layer is the fact that I can first open a 
transaction before passing the connection along, and then I can commit the 
transaction when everything is done.  Thus my transactions are at the 
controller level, and can be managed there.

Back in my old VB/COM days, we had a sort of DB Utilities class which could 
be accessed from the datalayer.  You would ask it to give you a connection, 
and it would get it for you.  Should I make my own class for datasource 
access which is intitalized upon application start with the Datasource 
object found by struts?  Then the rest of my datalayer can simply use it?



Craig W. Tataryn

Send and receive Hotmail on your mobile device:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message