Click here to Skip to main content
15,903,388 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
AnswerRe: Consultant/Principal/Senior Software Engineer Pin
Pete O'Hanlon15-Jul-09 23:34
mvePete O'Hanlon15-Jul-09 23:34 
GeneralRe: Consultant/Principal/Senior Software Engineer Pin
Paul Conrad25-Jul-09 19:26
professionalPaul Conrad25-Jul-09 19:26 
GeneralRe: Consultant/Principal/Senior Software Engineer Pin
Pete O'Hanlon29-Jul-09 9:11
mvePete O'Hanlon29-Jul-09 9:11 
GeneralRe: Consultant/Principal/Senior Software Engineer Pin
Paul Conrad29-Jul-09 12:39
professionalPaul Conrad29-Jul-09 12:39 
AnswerRe: Consultant/Principal/Senior Software Engineer Pin
Eddy Vluggen16-Jul-09 2:27
professionalEddy Vluggen16-Jul-09 2:27 
QuestionIs this an existing pattern Pin
sadavoya15-Jul-09 7:30
sadavoya15-Jul-09 7:30 
AnswerRe: Is this an existing pattern Pin
CodingYoshi15-Jul-09 17:27
CodingYoshi15-Jul-09 17:27 
GeneralRe: Is this an existing pattern Pin
sadavoya17-Jul-09 5:31
sadavoya17-Jul-09 5:31 
I'm mostly curious. I'm wondering if such a pattern, or something similar (or better or more fully thought out) has emerged already in the community.

I know this code doesn't match a GOF pattern, and that it looks like a not-very-good singleton. You might call it a singleton for the calling scope of Bar.GetAGetter(). There's nothing to prevent two scopes from getting separate values though. Indeed, a single scope can get two separate values simply by calling Bar.GetAGetter() twice - each call returns a method that returns a distinct value. This is by design - it's not supposed to be a singleton.

Like I said, I think the value of Bar is that it encapsulates lazy instanciation. Since lazy instanciation is very common, and it takes 3-5 lines of code every time, and this replaces it with 1 line of code, encapsulating it seems like a good idea for all the usual code reuse reasons.
QuestionDTO design supporting multiple tables Pin
Leftyfarrell15-Jul-09 6:10
Leftyfarrell15-Jul-09 6:10 
AnswerRe: DTO design supporting multiple tables Pin
CodingYoshi15-Jul-09 17:33
CodingYoshi15-Jul-09 17:33 
QuestionRe: DTO design supporting multiple tables Pin
Leftyfarrell16-Jul-09 1:51
Leftyfarrell16-Jul-09 1:51 
AnswerRe: DTO design supporting multiple tables Pin
CodingYoshi16-Jul-09 3:24
CodingYoshi16-Jul-09 3:24 
GeneralRe: DTO design supporting multiple tables Pin
Leftyfarrell16-Jul-09 3:58
Leftyfarrell16-Jul-09 3:58 
GeneralRe: DTO design supporting multiple tables Pin
CodingYoshi16-Jul-09 8:05
CodingYoshi16-Jul-09 8:05 
GeneralRe: DTO design supporting multiple tables Pin
Leftyfarrell16-Jul-09 9:56
Leftyfarrell16-Jul-09 9:56 
GeneralRe: DTO design supporting multiple tables Pin
CodingYoshi16-Jul-09 17:13
CodingYoshi16-Jul-09 17:13 
QuestionOODB or RDB for checkbook/budget program? Pin
copec10-Jul-09 17:15
copec10-Jul-09 17:15 
AnswerRe: OODB or RDB for checkbook/budget program? Pin
riced11-Jul-09 10:06
riced11-Jul-09 10:06 
GeneralRe: OODB or RDB for checkbook/budget program? [modified] Pin
copec11-Jul-09 11:25
copec11-Jul-09 11:25 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
riced12-Jul-09 2:12
riced12-Jul-09 2:12 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
copec12-Jul-09 7:08
copec12-Jul-09 7:08 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
riced12-Jul-09 21:07
riced12-Jul-09 21:07 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
copec14-Jul-09 11:15
copec14-Jul-09 11:15 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
riced14-Jul-09 20:55
riced14-Jul-09 20:55 
GeneralRe: OODB or RDB for checkbook/budget program? Pin
copec15-Jul-09 3:49
copec15-Jul-09 3:49 

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.