Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OOP

Status
Not open for further replies.

xloop

Programmer
Nov 12, 2001
86
GB
Hi all

I've been programming commercially in VB for about 2 years now, i know C/C++ quite well and im im pretty much there with C# syntax too.

My question is how does OOP fit into my applications?

Everytime i read tutorials on this subject it all makes perfect sense but when you try and put it in to practice it doesn't seem to go as smooth as i'd like.

As an example i have a tblClients table in SQL which basically holds some basic information on our clients..

Would i build a Client Class for this object? Would i make the columns in the the table the field variables of the class?

I can see how all this would work simply by providing methods of the client class but this doesn't seem right???

Thanks in advance
Rob
 
Doing an object-to-relational mapping is a black art. You can map them one-for-one (objClient controls access to tblClient), or if you have many tables that make up a client you can do a one-to-many mapping (objClient controls access to tblClient, tblClientLocation, tblClientPhone, etc). You could even do a many-to-one mapping (objRecurringClient, objOneTimeClient both access tblClient). It all depends on the needs of your application, and how you intend to do things in your application.

From what I've learned of the UP (Unified Process) you should design your objects irregardless of how their state will be stored, and as a later step decide on how to keep them in a database (or even a flat-file!). You might end up with one table, many tables, or no tables.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top