Click here to Skip to main content
12,509,932 members (51,539 online)

Design and Architecture

 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 4:36
memberVuNic15-May-12 4:36 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 4:53
protectorPete O'Hanlon15-May-12 4:53 
AnswerRe: Simple composition - Your thoughts? Pin
BobJanova15-May-12 0:46
memberBobJanova15-May-12 0:46 
AnswerRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 1:51
protectorMarc Clifton15-May-12 1:51 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 1:57
protectorPete O'Hanlon15-May-12 1:57 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 2:45
protectorMarc Clifton15-May-12 2:45 
GeneralRe: Simple composition - Your thoughts? Pin
Pete O'Hanlon15-May-12 3:25
protectorPete O'Hanlon15-May-12 3:25 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 4:57
protectorMarc Clifton15-May-12 4:57 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 4:41
memberVuNic15-May-12 4:41 
GeneralRe: Simple composition - Your thoughts? Pin
Marc Clifton15-May-12 5:06
protectorMarc Clifton15-May-12 5:06 
GeneralRe: Simple composition - Your thoughts? Pin
VuNic15-May-12 18:32
memberVuNic15-May-12 18:32 
QuestionDatabase Modeling - Conditional Relationships Pin
Leslie Sanford11-May-12 8:34
memberLeslie Sanford11-May-12 8:34 
AnswerRe: Database Modeling - Conditional Relationships Pin
mark merrens11-May-12 9:49
membermark merrens11-May-12 9:49 
GeneralRe: Database Modeling - Conditional Relationships Pin
Leslie Sanford12-May-12 8:42
memberLeslie Sanford12-May-12 8:42 
Thanks for your reply.

The solution I've settled on uses part of your answer. I have a 'base' table for all items. Then I have tables where needed for 'derived' sub types. These derived tables have a 'zero to one' relationship to the base table. The derived tables are a way of extending the properties of items in the base table.

So the items table could look like this:

+----+--------+-------+
| id | name   | price |
+----+--------+-------+
|  1 | wheel  | $1.23 |
+----+--------+-------+
|  2 | wire   | $1.50 |
+----+--------+-------+

Then if there are more than one kind of cogs, I can subclass them in 'derived' tables (like derived classes in object oriented programming).

wheels table
 
+----+--------+--------+
| id | cog_id | radius |
+----+--------+--------+
|  1 |    1   |   50"  |
+----+--------+--------+

wires table
 
+----+--------+--------+
| id | cog_id | length |
+----+--------+--------+
|  1 |    2   |   12"  |
+----+--------+--------+

I can then do joins to get back only wheels, and another join to get just wires.

I'm not sure if this is a common approach. I know the joins will cost more processing, but at least the schema makes sense to me.
AnswerRe: Database Modeling - Conditional Relationships Pin
Eddy Vluggen13-May-12 4:32
memberEddy Vluggen13-May-12 4:32 
AnswerRe: Database Modeling - Conditional Relationships Pin
jschell14-May-12 9:24
memberjschell14-May-12 9:24 
Questionhow to design base class? Pin
wan.rui@qq.com10-May-12 17:09
memberwan.rui@qq.com10-May-12 17:09 
AnswerRe: how to design base class? Pin
walterhevedeich10-May-12 19:29
memberwalterhevedeich10-May-12 19:29 
AnswerRe: how to design base class? Pin
Pete O'Hanlon10-May-12 21:52
protectorPete O'Hanlon10-May-12 21:52 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 22:11
memberwan.rui@qq.com10-May-12 22:11 
GeneralRe: how to design base class? Pin
BobJanova15-May-12 0:48
memberBobJanova15-May-12 0:48 
GeneralRe: how to design base class? Pin
wan.rui@qq.com10-May-12 22:15
memberwan.rui@qq.com10-May-12 22:15 
GeneralRe: how to design base class? Pin
TorstenH.15-May-12 0:00
memberTorstenH.15-May-12 0:00 
QuestionActive Directory Pin
Franklin lloyd10-May-12 7:13
memberFranklin lloyd10-May-12 7:13 
AnswerRe: Active Directory Pin
jschell10-May-12 9:27
memberjschell10-May-12 9:27 
QuestionSingle web solution vs web app + mobile web app Pin
logicaldna8-May-12 22:56
memberlogicaldna8-May-12 22:56 
AnswerRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya9-May-12 7:34
memberAniruddha Loya9-May-12 7:34 
GeneralRe: Single web solution vs web app + mobile web app Pin
logicaldna9-May-12 17:22
memberlogicaldna9-May-12 17:22 
SuggestionRe: Single web solution vs web app + mobile web app Pin
Aniruddha Loya10-May-12 10:50
memberAniruddha Loya10-May-12 10:50 
AnswerRe: Single web solution vs web app + mobile web app Pin
RobCroll18-May-12 3:23
memberRobCroll18-May-12 3:23 
QuestionDOC/View/Mainframe or does it matter? Pin
BarryPearlman8-May-12 11:52
memberBarryPearlman8-May-12 11:52 
AnswerRe: DOC/View/Mainframe or does it matter? Pin
Pete O'Hanlon8-May-12 11:59
protectorPete O'Hanlon8-May-12 11:59 
QuestionASP.net Duobt Pin
SureshBabu S5-May-12 18:29
memberSureshBabu S5-May-12 18:29 
AnswerRe: ASP.net Duobt Pin
OriginalGriff5-May-12 19:30
mvpOriginalGriff5-May-12 19:30 
AnswerMy vote of 1 Pin
Keith Barrow5-May-12 23:05
mentorKeith Barrow5-May-12 23:05 
JokeRe: ASP.net Duobt Pin
Manfred R. Bihy10-May-12 3:44
mvpManfred R. Bihy10-May-12 3:44 
QuestionWhat language is this? Pin
sczii5-May-12 15:15
membersczii5-May-12 15:15 
AnswerRe: What language is this? Pin
Prikarna6-May-12 0:25
memberPrikarna6-May-12 0:25 
GeneralRe: What language is this? Pin
jschell7-May-12 8:46
memberjschell7-May-12 8:46 
GeneralRe: What language is this? Pin
Prikarna10-May-12 0:36
memberPrikarna10-May-12 0:36 
AnswerRe: What language is this? Pin
Apocalypse Now11-May-12 22:15
memberApocalypse Now11-May-12 22:15 
AnswerRe: What language is this? Pin
kishhr22-Jun-12 9:06
memberkishhr22-Jun-12 9:06 
Questionproject for you Pin
silverbuyer1-May-12 18:43
membersilverbuyer1-May-12 18:43 
QuestionDilemma on exposing methods in interface based programming Pin
SSEAR22-Apr-12 23:11
memberSSEAR22-Apr-12 23:11 
AnswerRe: Dilemma on exposing methods in interface based programming Pin
VallarasuS24-Apr-12 5:12
memberVallarasuS24-Apr-12 5:12 
AnswerRe: Dilemma on exposing methods in interface based programming Pin
jschell28-Apr-12 7:52
memberjschell28-Apr-12 7:52 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
SSEAR29-Apr-12 20:53
memberSSEAR29-Apr-12 20:53 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
jschell30-Apr-12 8:00
memberjschell30-Apr-12 8:00 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
SSEAR1-May-12 20:28
memberSSEAR1-May-12 20:28 
GeneralRe: Dilemma on exposing methods in interface based programming Pin
jschell2-May-12 10:57
memberjschell2-May-12 10:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160929.1 | Last Updated 15 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid