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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application Design

Status
Not open for further replies.

xloop

Programmer
Nov 12, 2001
86
GB

I have an application that i'm writing but i would like some advice on the best of doing it, i'm going to simplify it so it doesn't get to complicated;

The system basically manages projects.

There are Customers, projects, jobs and Tasks.

Tasks have a one to many relationship with Jobs
Jobs have a one to many relationship with Projects
Projects have a one to many relationship with Clients

So i have a clients table, projects table, jobs table and tasks table.

So far so good.

The application is going to be designed with MDI.

What is the best strategy for designing my classes.
I would like to have Client class that i can create when the user picks a client from a list. ie;

Client Cust1 = new Client(ID) // pass in ID

My questions are,
On creation of the object would you return all you columns from the db and set all your fields in the class?
Would you use databinding so you could databind columns directly to controls on your form?

What is the best way to do this entire architecture.
I could for instance just use static methods to return a dataset which i could then use to bind my controls but this doesn't feel very Object Orientated.

Becuase Clients and Projects are related, should i create a Project Class inside my Client class? how do i relate them?

Any views on this?

 
I'd build custom collection classes for Projects, Jobs and Tasks and put them in the appropriate parent classes (i.e. Client.Projects, Project.Jobs, Job.Tasks). Each contained class should know about the object that owns it (i.e. Project.Client).

Rockford Lhotka discussed such design in his books, "Visual Basic 6 Business Objects", and "Visual Basic 6 Distributed Objects". If you've not seen these books, they are a good dissertation on how to build 3-tier application systems.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top