[OOD] Class design for with Database back end

Satal Keto

Well-known member
Joined
May 15, 2006
Messages
86
Programming Experience
5-10
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.

For example with my other applications, I have done a couple of things;
1) Gathered all the data 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 :D
 
If you are wanting to use a true object orientated approach, you might want to look at an OR Mapper.
NHibernate (.Net port of Hibernate) with Fluent and Linq2NHibernate might be an option, because it's OS and free.
If money and OS arent important there are quite some commercial solutions out there.
 

Latest posts

Back
Top