Click here to Skip to main content
15,897,891 members
Home / Discussions / Design and Architecture
   

Design and Architecture

 
GeneralRe: singleton pattern example Pin
led mike4-Sep-07 6:45
led mike4-Sep-07 6:45 
GeneralRe: singleton pattern example Pin
DavidNohejl4-Sep-07 7:28
DavidNohejl4-Sep-07 7:28 
GeneralRe: singleton pattern example Pin
led mike4-Sep-07 7:35
led mike4-Sep-07 7:35 
GeneralRe: singleton pattern example Pin
DavidNohejl4-Sep-07 7:49
DavidNohejl4-Sep-07 7:49 
AnswerRe: singleton pattern example Pin
led mike4-Sep-07 5:03
led mike4-Sep-07 5:03 
JokeRe: singleton pattern example Pin
Colin Angus Mackay4-Sep-07 9:13
Colin Angus Mackay4-Sep-07 9:13 
AnswerRe: singleton pattern example Pin
Colin Angus Mackay4-Sep-07 13:08
Colin Angus Mackay4-Sep-07 13:08 
AnswerRe: singleton pattern example Pin
Urs Enzler4-Sep-07 21:37
Urs Enzler4-Sep-07 21:37 
I consider singletons as evil!

If there has to exist really one one instance of a class then I use a manager pattern (don't know if this patter has a real pattern name):

I request the "singleton" from a Manager that will return me the instance. Depending on configuration and other things it will return me a singleton or a new instance. Furthermore I request interfaces which allows the replacement of "singletons" either for testing (mocks) or changed requirements or if it is a base functionality that is used in different projects.

Much more flexible.

-^-^-^-^-^-
no risk no funk ................... please vote ------>

GeneralRe: singleton pattern example Pin
Colin Angus Mackay5-Sep-07 4:35
Colin Angus Mackay5-Sep-07 4:35 
GeneralRe: singleton pattern example Pin
Urs Enzler5-Sep-07 4:40
Urs Enzler5-Sep-07 4:40 
GeneralRe: singleton pattern example Pin
led mike5-Sep-07 6:24
led mike5-Sep-07 6:24 
GeneralRe: singleton pattern example Pin
Urs Enzler5-Sep-07 7:04
Urs Enzler5-Sep-07 7:04 
GeneralRe: singleton pattern example Pin
led mike5-Sep-07 7:27
led mike5-Sep-07 7:27 
GeneralRe: singleton pattern example Pin
Urs Enzler5-Sep-07 7:51
Urs Enzler5-Sep-07 7:51 
GeneralRe: singleton pattern example Pin
led mike5-Sep-07 8:07
led mike5-Sep-07 8:07 
GeneralRe: singleton pattern example Pin
Urs Enzler5-Sep-07 20:19
Urs Enzler5-Sep-07 20:19 
AnswerRe: singleton pattern example Pin
hotcodeking5-Sep-07 1:58
hotcodeking5-Sep-07 1:58 
AnswerRe: singleton pattern example [modified] Pin
ElSpinos13-Sep-07 23:00
ElSpinos13-Sep-07 23:00 
AnswerRe: singleton pattern example Pin
etkid8421-Sep-07 3:02
etkid8421-Sep-07 3:02 
QuestionApplications communication Pin
Yoav Zur28-Aug-07 19:18
Yoav Zur28-Aug-07 19:18 
AnswerRe: Applications communication Pin
led mike30-Aug-07 4:43
led mike30-Aug-07 4:43 
QuestionClass design help Pin
rsaint2727-Aug-07 3:18
rsaint2727-Aug-07 3:18 
GeneralRe: Class design help Pin
Paul Conrad27-Jan-08 7:12
professionalPaul Conrad27-Jan-08 7:12 
QuestionPromotion Table Schema Design Pin
yameen26-Aug-07 3:48
yameen26-Aug-07 3:48 
GeneralRe: Promotion Table Schema Design Pin
Paul Conrad27-Jan-08 7:13
professionalPaul Conrad27-Jan-08 7:13 

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.