Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
GeneralRe: How do you enforce use of dedicated factories? Pin
SledgeHammer016-Mar-12 6:56
SledgeHammer016-Mar-12 6:56 
AnswerRe: How do you enforce use of dedicated factories? Pin
jschell6-Mar-12 8:48
jschell6-Mar-12 8:48 
AnswerRe: How do you enforce use of dedicated factories? Pin
jschell6-Mar-12 8:56
jschell6-Mar-12 8:56 
AnswerRe: How do you enforce use of dedicated factories? Pin
Clifford Nelson6-Mar-12 14:26
Clifford Nelson6-Mar-12 14:26 
GeneralRe: How do you enforce use of dedicated factories? Pin
BobJanova6-Mar-12 21:42
BobJanova6-Mar-12 21:42 
AnswerRe: How do you enforce use of dedicated factories? Pin
Clifford Nelson7-Mar-12 7:55
Clifford Nelson7-Mar-12 7:55 
GeneralRe: How do you enforce use of dedicated factories? Pin
lmoelleb8-Mar-12 1:39
lmoelleb8-Mar-12 1:39 
AnswerRe: How do you enforce use of dedicated factories? Pin
lmoelleb8-Mar-12 1:48
lmoelleb8-Mar-12 1:48 
You could mark the constructor as obsolete with a message pointing people to the factory. Then use a pragma to suppress the warning in your factory when you call the constructor. It might look a bit ugly, but it will clearly point developers to the correct usage. Sometimes practical and explicit is more important than pretty. Smile | :)

For the discussion about using your pattern in the first place - Typically I would lean more towards an interface in Java and an abstract base class in .NET. This is what the respective developers would expect, and there are actually very good reasons for this difference as there are fundamental differences between the languages in this area.
Questionopen new tab in ie,mozilla and google chrome browers Pin
Rajkumartag6-Mar-12 0:02
Rajkumartag6-Mar-12 0:02 
AnswerRe: open new tab in ie,mozilla and google chrome browers Pin
Eddy Vluggen6-Mar-12 0:37
professionalEddy Vluggen6-Mar-12 0:37 
AnswerRe: open new tab in ie,mozilla and google chrome browers Pin
BobJanova6-Mar-12 0:41
BobJanova6-Mar-12 0:41 
GeneralRe: open new tab in ie,mozilla and google chrome browers Pin
Vasudevan Deepak Kumar9-Mar-12 9:59
Vasudevan Deepak Kumar9-Mar-12 9:59 
QuestionFile upload using http Pin
Sebastian T Xavier5-Mar-12 18:55
Sebastian T Xavier5-Mar-12 18:55 
AnswerRe: File upload using http Pin
Pete O'Hanlon5-Mar-12 21:43
mvePete O'Hanlon5-Mar-12 21:43 
GeneralRe: File upload using http Pin
Sebastian T Xavier5-Mar-12 22:03
Sebastian T Xavier5-Mar-12 22:03 
AnswerRe: File upload using http Pin
DonDiegoDeLaVega5-Mar-12 21:49
DonDiegoDeLaVega5-Mar-12 21:49 
GeneralRe: File upload using http Pin
Sebastian T Xavier5-Mar-12 22:03
Sebastian T Xavier5-Mar-12 22:03 
QuestionMerge cell in datagrid C# Pin
daitranthanhhoa5-Mar-12 16:14
daitranthanhhoa5-Mar-12 16:14 
AnswerRe: Merge cell in datagrid C# Pin
Dave Kreskowiak5-Mar-12 16:18
mveDave Kreskowiak5-Mar-12 16:18 
QuestionWeb Browser to C# application Pin
TKCA5-Mar-12 15:54
TKCA5-Mar-12 15:54 
AnswerRe: Web Browser to C# application Pin
Dave Kreskowiak5-Mar-12 16:18
mveDave Kreskowiak5-Mar-12 16:18 
GeneralRe: Web Browser to C# application Pin
TKCA5-Mar-12 16:56
TKCA5-Mar-12 16:56 
GeneralRe: Web Browser to C# application Pin
Dave Kreskowiak5-Mar-12 17:03
mveDave Kreskowiak5-Mar-12 17:03 
GeneralRe: Web Browser to C# application Pin
TKCA7-Mar-12 2:24
TKCA7-Mar-12 2:24 
GeneralRe: Web Browser to C# application Pin
Dave Kreskowiak7-Mar-12 3:57
mveDave Kreskowiak7-Mar-12 3:57 

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.