Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Object Oriented Design and databases

Posted on 2004-09-20
Medium Priority
Last Modified: 2013-11-23
I am currently reading "Beginning C# Objects: From Concepts to Code" It is pointing me down the right path of writting more object oriented programs. However the book doesn't really talk about integrating w/ a database.  The example they give is a student registration program, where students register for college classes. It talks about having a Person Class w/ all the attributes of person and then Student class and a Professor class that inherits from the Person class. Does this mean in my database I should have 3 tables, Person, Strudent , and Prof? Also, I'm somewhat familiar w/ how does this all tie in?  If I have 2 tables to do CRUD (Create, Read, Update, and delete) when working w/ a Student or a Prof it seems like more work to do?
Question by:lyptus
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 37

Assisted Solution

gregoryyoung earned 200 total points
ID: 12108235
I would take a look at object persistance. A great framework can be found for free in (a quick google brings it right up).

if you by chance prefer to buy things, is definately worth a look at.

Gentle uses C# attributes on your classes to map them back to the database, it will also handle the brokerring of your objects.

Another one I recently saw which looked decent is the WilsonORMapper (again a google brings it up)


LVL 101

Accepted Solution

mlmcc earned 800 total points
ID: 12108821
>>Does this mean in my database I should have 3 tables, Person, Strudent , and Prof?
This really depends on the database.  In a relational database you would build
Person - All common information on a person (Name, address, etc)
Prof - Unique information for a professor and link to person (Department, full/assist/assoc etc)
Student - Unique information on stuidents and link to person (YearGrad,credits, courses, etc)

I haven't worked with an O-O database but it seems to me you would have similar table structure but you would create a student which would also create the person record.

>>If I have 2 tables to do CRUD (Create, Read, Update, and delete) when working w/ a Student or a Prof it seems like more work to do?
Actually the only truly additional work is the adding the link to the student or prof table and creating the record in the student or prof table.  Since the common information is in the person table it is entered only once.

LVL 101

Expert Comment

ID: 12118151
Glad I could help


Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question