none
Using DataObjects in an OOP environment RRS feed

  • Question

  • This question is a little involved, but I would really appreciate some guidance. I have been studying (in my job) how to implement object orientated programming and using data objects to communicate with a data source. I am putting this knowledge to use in my current project - a simple help desk program.

     

    I have a form, which the takes input from the user to display, modify and create records in 4 tables of a SQL database.

     

    I believe that one or more of these statements displays incorrect practice, and would explain the area where I am going wrong.

     

    • My form creates my class instances, which interact with my DataSet, which fill and update the DataAdapters, which send and retrieve data to and from my SQL database.
    • The only method by which I could manage to generate typed dataset access (that is supported by the IDE) was to use the form designer to automatically generate my DataAdapters and DataSet.
    • It is my class declarations that need access to the DataSet and DataAdapters, not my form, but I wish to use the same data objects throughout my application, rather than defining new connections for each operation (or class instance).
    • The only method, following this model, to allow my classes access to my form.DataSet is to pass the DataSet as a parameter in the new method of each of my classes’ instantiations.

     

     

    I’m sure (hopefully!) that there are just one or two design concepts that I’m not grasping here.

     

     

    Many thanks for any advise you can provide.

     

                Shane

     

    Monday, November 20, 2006 10:24 AM

Answers

  • This was answered in another forum, for anyone who is similarly confused :)

    http://www.vbforums.com/showthread.php?t=438964

        Shane
    Monday, December 11, 2006 2:08 AM