Jump to content

Class design for with Database back end

Satal Keto

Recommended Posts

Hi, I was hoping that I could get some guidance from some of you guys on Object Design with Database back ends.

I am trying to build what could be considered to be my first full scale application, which is a student tracker (simplification). While I have a reasonable idea of how I would go about designing the classes for the system, the bit that I don't know how to do is, how I would go about getting the data to and from the database.

While I am programming this in VB.Net I think this would be a problem across all programming languages.

For example with my other applications, I have done a couple of things;

1) Gathered all the data from the database when the application started up, creating the objects then. Then when the application closed sending the data back to the database.

2) Have the code which deals with getting the data in the specific class, so the student class for example would take only one constructor argument which would be the studentID, then the class code would connect to the database and populate the object fields as appropriate.

3) Variations of the above.

I have also looked into LINQ, which seems like it would be very useful if you don't expect your classes to deal with any business logic and just data, but I suppose it would be possible to create a wrapper class that would include the business logic.

Anyway I hope that some of you guys/girls would be kind enough to either point me in the direction of some articles that maybe you have found useful on this subject or your views on what is the best methods for doing this (obviously there isn't going to be one God design pattern for this sort of thing, but some are more generic than others).

Thanks for any help/comments/suggestions in advance.

Satal :lol:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...