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

Design and Architecture

 
AnswerRe: UML Software Pin
Pete O'Hanlon12-Mar-09 0:10
mvePete O'Hanlon12-Mar-09 0:10 
AnswerRe: UML Software Pin
User 171649212-Mar-09 0:26
professionalUser 171649212-Mar-09 0:26 
AnswerRe: UML Software Pin
shakhtyor12-Mar-09 10:51
shakhtyor12-Mar-09 10:51 
GeneralCommunicating the Reason for Method Failure Pin
Brady Kelly9-Mar-09 2:58
Brady Kelly9-Mar-09 2:58 
GeneralRe: Communicating the Reason for Method Failure Pin
Luc Pattyn9-Mar-09 3:16
sitebuilderLuc Pattyn9-Mar-09 3:16 
GeneralRe: Communicating the Reason for Method Failure Pin
Brady Kelly9-Mar-09 3:18
Brady Kelly9-Mar-09 3:18 
GeneralRe: Communicating the Reason for Method Failure Pin
Luc Pattyn9-Mar-09 3:32
sitebuilderLuc Pattyn9-Mar-09 3:32 
GeneralRe: Communicating the Reason for Method Failure Pin
Mark Churchill9-Mar-09 13:47
Mark Churchill9-Mar-09 13:47 
Generally I'd go with throwing on any failure - it definitely leads to cleaner code (especially with errors bubbling up the stack and being handled at a convenient place). How you define "failure" then determines the behaviour.

"Entry not found in that file" would depend for me on your model. If every client must have a phone number then GetPhoneNumber(Client) should throw if there isn't one in the file. Either you are throwing an ArgumentException for an invalid client, or you are throwing because there is no phone number for the client - and *something* went wrong, which needs to be fixed.

If they might not have a phone number then returning null to indicate "none" is probably appropriate.

If it returns null when it detects an error, then you are moving the error detection to the client code, which is kinda silly. Theres probably lots of "client" code for the library - and this means you are duplicating a bunch of code. It also means you have created some pretty close coupling as well.

Whatever you do, make sure its clearly documented.


GeneralRe: Communicating the Reason for Method Failure Pin
led mike10-Mar-09 5:54
led mike10-Mar-09 5:54 
GeneralRe: Communicating the Reason for Method Failure Pin
Brady Kelly10-Mar-09 5:58
Brady Kelly10-Mar-09 5:58 
GeneralA re-introduction to TDD Pin
Brady Kelly9-Mar-09 2:09
Brady Kelly9-Mar-09 2:09 
GeneralHigh Level Design for Installation and Upgrade Application Pin
Brady Kelly6-Mar-09 8:49
Brady Kelly6-Mar-09 8:49 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Jonathan Davies8-Mar-09 4:11
Jonathan Davies8-Mar-09 4:11 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Brady Kelly8-Mar-09 4:25
Brady Kelly8-Mar-09 4:25 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Jonathan Davies8-Mar-09 5:25
Jonathan Davies8-Mar-09 5:25 
GeneralRe: High Level Design for Installation and Upgrade Application Pin
Brady Kelly8-Mar-09 5:47
Brady Kelly8-Mar-09 5:47 
QuestionCache Manager design problem Pin
Steve Holdorf28-Feb-09 9:07
Steve Holdorf28-Feb-09 9:07 
QuestionRe: Cache Manager design problem [modified] Pin
Steve Holdorf28-Feb-09 14:34
Steve Holdorf28-Feb-09 14:34 
AnswerRe: Cache Manager design problem Pin
Steve Holdorf1-Mar-09 9:53
Steve Holdorf1-Mar-09 9:53 
QuestionReverse engineering the vc++ project Pin
hariakuthota19-Feb-09 22:28
hariakuthota19-Feb-09 22:28 
AnswerRe: Reverse engineering the vc++ project Pin
bobbery19-Feb-09 23:12
bobbery19-Feb-09 23:12 
AnswerRe: Reverse engineering the vc++ project Pin
Han van Roosmalen3-Mar-09 20:55
Han van Roosmalen3-Mar-09 20:55 
QuestionResource Allocation Logic Pin
Nagarajan Mohan18-Feb-09 2:52
Nagarajan Mohan18-Feb-09 2:52 
QuestionDesign question about layers and MVC Pin
Fernando A. Gomez F.14-Feb-09 11:56
Fernando A. Gomez F.14-Feb-09 11:56 
AnswerRe: Design question about layers and MVC Pin
Jonathan Davies18-Feb-09 3:11
Jonathan Davies18-Feb-09 3:11 

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.