Results 1 to 4 of 4

Thread: Wrap DB access

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    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

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Have you seen this :
    Microsoft Application Blocks for .NET

    http://msdn.microsoft.com/library/de...ml/daab-rm.asp

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    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.

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width