-
Wrap DB access
I was thinking about databases when I recently started rather big project. And I got a few ideas about which would be the easiest way to give a web or cs application database support.
My thougt was to create a class that uses interfaces that the user can use to get the data required from any given database (conn string).
I need five classes
*connection (IConnection)
*datareader(IDataReader
*dataadapter(IDataAdapter)
This is the only class the user ever have to work with
it creates all other classes/interfaces))
*dbAccess(IDbAccess)
So, my only real problem is how to handle stored procedures. My company is mainly working with stored procedures and since they can be rather customizable(it would be rather easy to work with SQL-text ONLY), I haven't found an intelligent way to implement SP into this DbAccess class... The code to do it would be heavier than just declare an oledbcommand and an adapter and add some parameters and execute.
Anyone that has done something like this and have some comments?
In ADO and ASP we did this the simple way by creating class modules that contained lots of methods for fetching the information. It didn't use any of the nice features of OO.
kind regards
henrik
-
Have you seen this :
Microsoft Application Blocks for .NET
http://msdn.microsoft.com/library/de...ml/daab-rm.asp
-
No I haven't... thanks!
The goal of the project Im working on is to introduce OO thinking in web development. We have created usecases and classes and I have started to look into the use of patterns. I have decided to use factory patterns for object creation.
Any and all information about asp.net and OO/patterns would really be helpful.
-
We use OleDb and Oracle in all our development. Has anyone tried replacing the sql specific code with more generic oledb code? Or else I will give it a try. It shouldn't be any trouble, the only concern I have is how this class ask the database for SP parameter information...
kind regards
Henrik