Click here to Skip to main content
15,887,442 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: Refactoring the code or dessign? Pin
led mike25-Jul-08 5:18
led mike25-Jul-08 5:18 
GeneralException Handling in Desktop Application Pin
Brady Kelly25-Jun-08 2:54
Brady Kelly25-Jun-08 2:54 
GeneralRe: Exception Handling in Desktop Application Pin
Steven A. Lowe13-Sep-08 17:06
Steven A. Lowe13-Sep-08 17:06 
QuestionObject Composition Pin
Leslie Sanford24-Jun-08 17:27
Leslie Sanford24-Jun-08 17:27 
AnswerRe: Object Composition Pin
led mike25-Jun-08 4:30
led mike25-Jun-08 4:30 
GeneralNatural vs Surrogate Keys [modified*2] Pin
Brady Kelly20-Jun-08 10:15
Brady Kelly20-Jun-08 10:15 
GeneralRe: Natural vs Surrogate Keys Pin
mr_lasseter25-Jun-08 13:37
mr_lasseter25-Jun-08 13:37 
GeneralRe: Natural vs Surrogate Keys [modified*2] Pin
Jeremy Tierman5-Jul-08 12:53
Jeremy Tierman5-Jul-08 12:53 
If you want to generate the invoice number as a natural key in code, I might suggest a singleton that would be responsible for generating it (possibly date + sequence based), however, you need to consider other factors that would get messy by storing the "Invoice Number" as a single column.

For instance, if the system started generating invoices today (080705-001) and shuts down unexpectedly, say at 10am, when it starts back up, it would have to reparse the invoice numbers (like '080705-%' to get the last sequence number...obviously, this would be far from ideal. Also, by storing the invoice number in the database, you are now "stuck" with the formating decision you made at design time. If you start generating more that 1000 invoices today, you will have duplicate invoice numbers (another bad situation). Many systems push back the ultimate problem by adding customer id to the invoice number...

Anyway, if you store the invoice date separate from the sequence number, you can retrieve the last sequence number quicker, you are not stuck with a format problem, and you can move the format issue to your business layer if you do have issues.
QuestionServer side patterns in C++ Pin
variantseeker19-Jun-08 8:20
variantseeker19-Jun-08 8:20 
AnswerRe: Server side patterns in C++ Pin
led mike26-Jun-08 5:23
led mike26-Jun-08 5:23 
QuestionObserver - Redundant Updates Pin
Leslie Sanford18-Jun-08 23:06
Leslie Sanford18-Jun-08 23:06 
AnswerRe: Observer - Redundant Updates Pin
led mike20-Jun-08 5:27
led mike20-Jun-08 5:27 
GeneralRe: Observer - Redundant Updates Pin
Leslie Sanford20-Jun-08 6:07
Leslie Sanford20-Jun-08 6:07 
GeneralRe: Observer - Redundant Updates Pin
led mike20-Jun-08 6:40
led mike20-Jun-08 6:40 
AnswerRe: Observer - Redundant Updates Pin
mr_lasseter25-Jun-08 13:36
mr_lasseter25-Jun-08 13:36 
AnswerRe: Observer - Redundant Updates Pin
Adam Jasper25-Jun-08 22:57
Adam Jasper25-Jun-08 22:57 
AnswerRe: Observer - Redundant Updates Pin
Pete O'Hanlon25-Jun-08 23:30
mvePete O'Hanlon25-Jun-08 23:30 
GeneralRe: Observer - Redundant Updates Pin
Leslie Sanford26-Jun-08 8:18
Leslie Sanford26-Jun-08 8:18 
GeneralPattern for Shared Dropdown Tables Pin
Brady Kelly12-Jun-08 3:33
Brady Kelly12-Jun-08 3:33 
GeneralRe: Pattern for Shared Dropdown Tables Pin
led mike12-Jun-08 4:47
led mike12-Jun-08 4:47 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Brady Kelly12-Jun-08 5:30
Brady Kelly12-Jun-08 5:30 
GeneralRe: Pattern for Shared Dropdown Tables Pin
led mike12-Jun-08 5:40
led mike12-Jun-08 5:40 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Brady Kelly12-Jun-08 5:53
Brady Kelly12-Jun-08 5:53 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Pete O'Hanlon12-Jun-08 9:23
mvePete O'Hanlon12-Jun-08 9:23 
GeneralRe: Pattern for Shared Dropdown Tables Pin
Brady Kelly13-Jun-08 1:59
Brady Kelly13-Jun-08 1:59 

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.