[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

organising vb project

Posted on 2002-03-26
1
Medium Priority
?
141 Views
Last Modified: 2010-05-02
I am trying to plan a project that has multiple tables with related parts

so far i have these tables

On an Add form i'm going to get the user to input

Part Number (required)
Accessory, Series,Type (optional)
Bearing,Block,Chain,Disc,DriveShaft,Gear,Roller (one required)

when this is input the program should add a new record into all the related tables

Transmission will always be updated with

Part Number
TransTypeID (Series + Type values checked - if they exist in database then get the ID for record and record it here.          Otherwise add a new record to Transmission Type + record TransTypeID here)

TransDescID (Bearing, Block etc are checked for values. If Block value entered, program checks Transmission Descriptions Table for correct TransDescID for a Block. This value is entered here. The Block Table is then updated.

So i think i have all this clear in my head. But i'm not sure how i should organise the project? Should i have a class for each of these tables. Or should i have one class that represents all Transmission parts?



Transmission

Part Number     text
Accessory     text
TransTypeID     number
TransDescID     number

Transmission Type

TransTypeID     number
Series          text
Type          text

Transmission Descriptions

TransDescID     text
Description     text

Bearing

Part Number     text
Description     text

Block

Part Number     text
Description     text

Chain

Part Number     text
Description     text

Disc

Part Number     text
Description     text

DriveShaft

Part Number     text
Description     text

Gear

Part Number     text
Description     text

Roller

Part Number     text
Description     text

0
Comment
Question by:jhaigh
[X]
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
1 Comment
 
LVL 18

Accepted Solution

by:
mdougan earned 400 total points
ID: 6896404
Early on, it was popular to try to have a class for every table.  The idea was that the class was just a server of the data.

But, the problem with that is that it means that the programmers using the class have to have a lot more knowledge about how all the classes fit together to form the more complex "object" in this case, the transmission, and that's really more than should be required.

In a well designed application, you should encapsulate all of the stuff related to a transmission into a single class.  Bury all of the details about what tables have to be updated inside of the class.  Then, in the future, programmers using your class will just have to provide the attributes of a transmission, and your class will, behind the scenes, make sure they all get to the proper tables.

This has the added advantage that the database might change in structure, and if you just change the "implementation" (the code inside) of your class, without changing the "interface" (the public function that users of your class are calling) then it will keep from breaking all of the applications that use your class...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

649 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