M
Mike Gleason jr Couturier
Hi,
I'm programming a web site and I separated the web UI layer from the
business objects layer...
But the objects in the business layer needs a query string for database
access.. The client (the website) is responsible to provide this connection
string.
Right now, every time a page needs to interact with a business object
(methods), the web page pass the connection string to the businees object
(each methods of the business objects has a connectionstring parameter).
Instead of doing this, I thought that I could initialize the business layer
with my connection string in the Application Start only once. ie.:
BusinessLayer.ConnectionInfo.ConnectionString =
ConfigurationManager.ConnectionStrings[...].Con[...]; The business objects
would then refer to BusinessLayer.ConnectionInfo every time it has to
connect the to the database...
But I don't know how to propery do that with static objects and
multi-threads implications and all that stuff... Is my idea good? How do you
guys proceed in those scenarios!?
Thanks
Mike
I'm programming a web site and I separated the web UI layer from the
business objects layer...
But the objects in the business layer needs a query string for database
access.. The client (the website) is responsible to provide this connection
string.
Right now, every time a page needs to interact with a business object
(methods), the web page pass the connection string to the businees object
(each methods of the business objects has a connectionstring parameter).
Instead of doing this, I thought that I could initialize the business layer
with my connection string in the Application Start only once. ie.:
BusinessLayer.ConnectionInfo.ConnectionString =
ConfigurationManager.ConnectionStrings[...].Con[...]; The business objects
would then refer to BusinessLayer.ConnectionInfo every time it has to
connect the to the database...
But I don't know how to propery do that with static objects and
multi-threads implications and all that stuff... Is my idea good? How do you
guys proceed in those scenarios!?
Thanks
Mike