Click here to Skip to main content
15,905,682 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Refactoring the code or dessign? Pin
Scott Dorman30-Jun-08 23:30
professionalScott Dorman30-Jun-08 23:30 
GeneralRe: Refactoring the code or dessign? Pin
led mike1-Jul-08 4:41
led mike1-Jul-08 4:41 
GeneralRe: Refactoring the code or dessign? Pin
Scott Dorman1-Jul-08 6:20
professionalScott Dorman1-Jul-08 6:20 
GeneralRe: Refactoring the code or dessign? Pin
led mike1-Jul-08 7:28
led mike1-Jul-08 7:28 
GeneralRe: Refactoring the code or dessign? Pin
dojohansen22-Jul-08 23:00
dojohansen22-Jul-08 23:00 
GeneralRe: Refactoring the code or dessign? Pin
led mike23-Jul-08 5:57
led mike23-Jul-08 5:57 
GeneralRe: Refactoring the code or dessign? Pin
dojohansen24-Jul-08 0:22
dojohansen24-Jul-08 0:22 
GeneralRe: Refactoring the code or dessign? Pin
led mike24-Jul-08 6:35
led mike24-Jul-08 6:35 
GeneralRe: Refactoring the code or dessign? Pin
Pete O'Hanlon24-Jul-08 8:45
mvePete O'Hanlon24-Jul-08 8:45 
GeneralRe: Refactoring the code or dessign? Pin
led mike24-Jul-08 8:58
led mike24-Jul-08 8:58 
GeneralRe: Refactoring the code or dessign? Pin
Pete O'Hanlon24-Jul-08 9:05
mvePete O'Hanlon24-Jul-08 9:05 
GeneralRe: Refactoring the code or dessign? Pin
led mike24-Jul-08 9:25
led mike24-Jul-08 9:25 
GeneralRe: Refactoring the code or dessign? Pin
Pete O'Hanlon24-Jul-08 9:42
mvePete O'Hanlon24-Jul-08 9:42 
GeneralRe: Refactoring the code or dessign? Pin
led mike24-Jul-08 10:18
led mike24-Jul-08 10:18 
GeneralRe: Refactoring the code or dessign? Pin
dojohansen25-Jul-08 2:04
dojohansen25-Jul-08 2:04 
GeneralRe: Refactoring the code or dessign? Pin
led mike25-Jul-08 4:46
led mike25-Jul-08 4:46 
GeneralRe: Refactoring the code or dessign? Pin
dojohansen25-Jul-08 4:53
dojohansen25-Jul-08 4:53 
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.

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.