Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > General > Database Concepts & Design > inventory design pattern?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-12-03, 15:55
dennispg dennispg is offline
Registered User
 
Join Date: Jun 2003
Posts: 6
inventory design pattern?

ive got a database design problem that i cant figure out. ive looked
around online quite a bit for any resources on design patterns that i
could try to use, but none of them seem to really fit perfectly. im
guessing id have better luck if i start looking in some books, but i
thought id try here first in case any one would be willing to help me
out.

it seems like my problem would be a fairly common one, so maybe im
just thinking about this the wrong way. basically what i want is a
sort of inventory system where every item has a unique id. given this
id, (most probably input from a barcode) i want to be able to find
information on it. theres all kinds of very different items though so
all the items cant be stored in the same table. i found the subclass
pattern is about what i want... i store all the common information in
a base table, and keep information unique to each type of item in a
different table, with its key being the same as the key in the base
table. the problem is, i dont see how to know what table to look in
for the extended information given just the id?

thanks for any help in advance!
Reply With Quote
  #2 (permalink)  
Old 06-27-03, 17:41
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 9,299
You need a field on your main table that indicates the object type, and which you can use to determine where to look up additional data.

blindman
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On