Click here to Skip to main content
11,480,938 members (59,054 online)

Design and Architecture

 
GeneralRe: Current Best Practices Pin
JonathanEdwards5-Sep-12 8:37
memberJonathanEdwards5-Sep-12 8:37 
GeneralRe: Current Best Practices Pin
dhofferber5-Sep-12 8:54
memberdhofferber5-Sep-12 8:54 
AnswerRe: Current Best Practices Pin
Expert Coming20-Sep-12 15:32
memberExpert Coming20-Sep-12 15:32 
QuestionNeed Suggestions For a Good Formal Requirements Tool Pin
Patricia.Jones012324-Aug-12 6:07
memberPatricia.Jones012324-Aug-12 6:07 
AnswerRe: Need Suggestions For a Good Formal Requirements Tool Pin
Eddy Vluggen26-Aug-12 0:39
memberEddy Vluggen26-Aug-12 0:39 
QuestionUI Guidelines Pin
Brian C Hart22-Aug-12 12:04
memberBrian C Hart22-Aug-12 12:04 
AnswerRe: UI Guidelines Pin
Pete O'Hanlon22-Aug-12 12:29
protectorPete O'Hanlon22-Aug-12 12:29 
QuestionUtility Field in Database Pin
eddieangel21-Aug-12 12:38
membereddieangel21-Aug-12 12:38 
I have three tables, ClaimEvent, Event, and EventScope. The actual ClaimEvent can be relevant to an entire claim, or a single property within a claim. Every property has a claimId.

As such, I have designed my tables like this:

Event
id | Int Identity AI
name | varchar
scopeId | int

EventScope
id | Int Identity AI
name | varchar

ClaimEvent
id | Int Identity AI
eventId | Int FK to Event
targetId | Int
date | DateTime

My idea is to use the targetId field in the ClaimEvent table to refer either to the Claim ID (if the event is relevant to the entire claim), or the Property ID (if the event is relevant only to the current property). If I want all events relevant to the selected claim, including properties within that claim, I can just match the targetId field with the id field in the property table when the scope is "property wide". Alternatively, I would have to design the table like this:

ClaimEvent
id | Int Identity AI
eventId | Int
claimId | Int
propertyId | Int?
date | DateTime

With the propertyId field frequently being null. However, I would be able to force FK constraints to the Claim and Property tables, which I can't do otherwise. The data is all going to be entered through a data entry form, with drop downs and very little possibility of FK violations, but it is always possible.

What do you guys think? I am always a fan of minimizing fields that will often be null, especially when I can repurpose another field, but it feels a little hackish.

Cheers, --EA
AnswerRe: Utility Field in Database Pin
Eddy Vluggen22-Aug-12 6:51
memberEddy Vluggen22-Aug-12 6:51 
AnswerRe: Utility Field in Database Pin
Nagy Vilmos22-Aug-12 7:07
memberNagy Vilmos22-Aug-12 7:07 
AnswerRe: Utility Field in Database Pin
BobJanova22-Aug-12 7:28
memberBobJanova22-Aug-12 7:28 
GeneralRe: Utility Field in Database Pin
eddieangel22-Aug-12 8:36
membereddieangel22-Aug-12 8:36 
GeneralRe: Utility Field in Database Pin
jschell22-Aug-12 9:55
memberjschell22-Aug-12 9:55 
GeneralRe: Utility Field in Database Pin
eddieangel22-Aug-12 10:00
membereddieangel22-Aug-12 10:00 
GeneralRe: Utility Field in Database Pin
jschell22-Aug-12 14:24
memberjschell22-Aug-12 14:24 
GeneralRe: Utility Field in Database Pin
eddieangel22-Aug-12 14:26
membereddieangel22-Aug-12 14:26 
GeneralRe: Utility Field in Database Pin
jschell23-Aug-12 9:12
memberjschell23-Aug-12 9:12 
GeneralRe: Utility Field in Database Pin
eddieangel23-Aug-12 9:23
membereddieangel23-Aug-12 9:23 
GeneralRe: Utility Field in Database Pin
jschell23-Aug-12 9:57
memberjschell23-Aug-12 9:57 
GeneralRe: Utility Field in Database Pin
eddieangel23-Aug-12 10:01
membereddieangel23-Aug-12 10:01 
GeneralRe: Utility Field in Database Pin
jschell24-Aug-12 9:28
memberjschell24-Aug-12 9:28 
GeneralRe: Utility Field in Database Pin
eddieangel24-Aug-12 9:31
membereddieangel24-Aug-12 9:31 
QuestionStandard exceptions for an RPC library? Pin
johndw9416-Aug-12 20:43
memberjohndw9416-Aug-12 20:43 
AnswerRe: Standard exceptions for an RPC library? Pin
Eddy Vluggen16-Aug-12 23:30
memberEddy Vluggen16-Aug-12 23:30 
GeneralRe: Standard exceptions for an RPC library? Pin
johndw9417-Aug-12 8:09
memberjohndw9417-Aug-12 8:09 

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 21 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid