Click here to Skip to main content
11,495,534 members (63,648 online)

Design and Architecture

 
GeneralRe: Simple composition - Your thoughts? Pin
Nagy Vilmos15-May-12 2:25
memberNagy Vilmos15-May-12 2:25 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 2:56
protectorPete O'Hanlon15-May-12 2:56 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 5:36
memberVuNic15-May-12 5:36 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 5:53
protectorPete O'Hanlon15-May-12 5:53 
AnswerRe: Simple composition - Your thoughts? Pin
BobJanova15-May-12 1:46
memberBobJanova15-May-12 1:46 
AnswerRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 2:51
protectorMarc Clifton15-May-12 2:51 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 2:57
protectorPete O'Hanlon15-May-12 2:57 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 3:45
protectorMarc Clifton15-May-12 3:45 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 4:25
protectorPete O'Hanlon15-May-12 4:25 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 5:57
protectorMarc Clifton15-May-12 5:57 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 5:41
memberVuNic15-May-12 5:41 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 6:06
protectorMarc Clifton15-May-12 6:06 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 19:32
memberVuNic15-May-12 19:32 
QuestionDatabase Modeling - Conditional Relationships Pin
Leslie Sanford11-May-12 9:34
memberLeslie Sanford11-May-12 9:34 
This is probably a really basic database design question, but for some reason, I'm struggling with it.

The real world problem I'm trying to solve is a little too escoteric to describe, so I'll try to use a generic example that presents the same problem.

Say a store sells two kinds of cogs. Each type of cog is represented in the database with its own table (they have sufficiently different characteristics to warent different table schemas). A customer can buy both kinds of cogs, and we want to keep track of their purchases. So we have a sales table that's associates the customer with the cogs he/she buys. One foreign key points to the customer, and another foreign points to the cog.

What's got me stumped is that the foreign key that points to the cog could be associated with either type of cogs. How do we know which? Do we create an additional field that tells us the type of cog the customer purchased? That rings alarms for me in that it's surely unnormalized.

So instead do we have seperate sales table for each type of cog? But wouldn't this lead to an explosion of tables as we add more cogs types to our inventory?

This must seem like a beginner's question; I'm an old C++ audio programmer who's become a 'web developer', so occasionally I get stumped on DB basics. Any help is appreciated. Smile | :)
AnswerRe: Database Modeling - Conditional Relationships Pin
mark merrens11-May-12 10:49
membermark merrens11-May-12 10:49 
GeneralRe: Database Modeling - Conditional Relationships Pin
Leslie Sanford12-May-12 9:42
memberLeslie Sanford12-May-12 9:42 
AnswerRe: Database Modeling - Conditional Relationships Pin
Eddy Vluggen13-May-12 5:32
memberEddy Vluggen13-May-12 5:32 
AnswerRe: Database Modeling - Conditional Relationships Pin
jschell14-May-12 10:24
memberjschell14-May-12 10:24 
Questionhow to design base class? Pin
wan.rui@qq.com10-May-12 18:09
memberwan.rui@qq.com10-May-12 18:09 
AnswerRe: how to design base class? Pin
walterhevedeich10-May-12 20:29
memberwalterhevedeich10-May-12 20:29 
AnswerRe: how to design base class? Pin
Pete O'Hanlon10-May-12 22:52
protectorPete O'Hanlon10-May-12 22:52 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 23:11
memberwan.rui@qq.com10-May-12 23:11 
GeneralRe: how to design base class? Pin
BobJanova15-May-12 1:48
memberBobJanova15-May-12 1:48 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 23:15
memberwan.rui@qq.com10-May-12 23:15 
GeneralRe: how to design base class? Pin
TorstenH.15-May-12 1:00
memberTorstenH.15-May-12 1:00 
QuestionActive Directory Pin
Franklin lloyd10-May-12 8:13
memberFranklin lloyd10-May-12 8:13 
AnswerRe: Active Directory Pin
jschell10-May-12 10:27
memberjschell10-May-12 10:27 
QuestionSingle web solution vs web app + mobile web app Pin
logicaldna8-May-12 23:56
memberlogicaldna8-May-12 23:56 
AnswerRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya9-May-12 8:34
memberAniruddha Loya9-May-12 8:34 
GeneralRe: Single web solution vs web app + mobile web app Pin
logicaldna9-May-12 18:22
memberlogicaldna9-May-12 18:22 
SuggestionRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya10-May-12 11:50
memberAniruddha Loya10-May-12 11:50 
AnswerRe: Single web solution vs web app + mobile web app Pin
RobCroll18-May-12 4:23
memberRobCroll18-May-12 4:23 
QuestionDOC/View/Mainframe or does it matter? Pin
BarryPearlman8-May-12 12:52
memberBarryPearlman8-May-12 12:52 
AnswerRe: DOC/View/Mainframe or does it matter? Pin
Pete O'Hanlon8-May-12 12:59
protectorPete O'Hanlon8-May-12 12:59 
QuestionASP.net Duobt Pin
SureshBabu S5-May-12 19:29
memberSureshBabu S5-May-12 19:29 
AnswerRe: ASP.net Duobt Pin
OriginalGriff5-May-12 20:30
mvpOriginalGriff5-May-12 20:30 
AnswerMy vote of 1 Pin
Keith Barrow6-May-12 0:05
mentorKeith Barrow6-May-12 0:05 
JokeRe: ASP.net Duobt Pin
Manfred R. Bihy10-May-12 4:44
mvpManfred R. Bihy10-May-12 4:44 
QuestionWhat language is this? Pin
sczii5-May-12 16:15
membersczii5-May-12 16:15 
AnswerRe: What language is this? Pin
Prikarna6-May-12 1:25
memberPrikarna6-May-12 1:25 
GeneralRe: What language is this? Pin
jschell7-May-12 9:46
memberjschell7-May-12 9:46 
GeneralRe: What language is this? Pin
Prikarna10-May-12 1:36
memberPrikarna10-May-12 1:36 
AnswerRe: What language is this? Pin
Apocalypse Now11-May-12 23:15
memberApocalypse Now11-May-12 23:15 
AnswerRe: What language is this? Pin
kishhr22-Jun-12 10:06
memberkishhr22-Jun-12 10:06 
Questionproject for you Pin
silverbuyer1-May-12 19:43
membersilverbuyer1-May-12 19:43 
QuestionDilemma on exposing methods in interface based programming Pin
SSEAR23-Apr-12 0:11
memberSSEAR23-Apr-12 0:11 
AnswerRe: Dilemma on exposing methods in interface based programming Pin
VallarasuS24-Apr-12 6:12
memberVallarasuS24-Apr-12 6:12 
AnswerRe: Dilemma on exposing methods in interface based programming Pin
jschell28-Apr-12 8:52
memberjschell28-Apr-12 8:52 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
SSEAR29-Apr-12 21:53
memberSSEAR29-Apr-12 21:53 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
jschell30-Apr-12 9:00
memberjschell30-Apr-12 9:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web03 | 2.8.150520.1 | Last Updated 26 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid