Click here to Skip to main content
15,912,072 members
Home / Discussions / C#
   

C#

 
AnswerRe: Best practice Pin
PIEBALDconsult7-May-12 6:13
mvePIEBALDconsult7-May-12 6:13 
AnswerRe: Best practice Pin
Jeremy Hutchinson7-May-12 7:03
professionalJeremy Hutchinson7-May-12 7:03 
I tend towards the static method mostly for consistency sake. If I need to return a list of those objects, which I often do, then I want a static method that queries the datasource once and returns a list of the objects.

I don't want that list retrieval method to make a bunch of calls to the objects constructor only to have the object query the datasource.

And of course I want to be able to get a single object in a similar manner as I get my list, thus static methods all the way.

I'm sure an argument can be made for the 'constructor with parameter' way as well. These things are almost never black and white.

GeneralRe: Best practice Pin
PIEBALDconsult7-May-12 7:38
mvePIEBALDconsult7-May-12 7:38 
GeneralRe: Best practice Pin
Jeremy Hutchinson7-May-12 8:39
professionalJeremy Hutchinson7-May-12 8:39 
GeneralRe: Best practice Pin
Not Active7-May-12 10:14
mentorNot Active7-May-12 10:14 
AnswerRe: Best practice Pin
mo5andes7-May-12 7:14
mo5andes7-May-12 7:14 
AnswerRe: Best practice Pin
BobJanova8-May-12 0:22
BobJanova8-May-12 0:22 
QuestionDictionary object (need logic) in C# Pin
Member 89377326-May-12 23:05
Member 89377326-May-12 23:05 
GeneralRe: Dictionary object (need logic) in C# Pin
harold aptroot7-May-12 0:38
harold aptroot7-May-12 0:38 
AnswerRe: Dictionary object (need logic) in C# Pin
Maciej Los7-May-12 1:22
mveMaciej Los7-May-12 1:22 
GeneralRe: Dictionary object (need logic) in C# Pin
Manfred Rudolf Bihy7-May-12 2:30
professionalManfred Rudolf Bihy7-May-12 2:30 
QuestionVertexBuffer for collection of vertex Pin
ITSparrow6-May-12 6:56
ITSparrow6-May-12 6:56 
AnswerRe: VertexBuffer for collection of vertex Pin
Luc Pattyn6-May-12 10:25
sitebuilderLuc Pattyn6-May-12 10:25 
QuestionLooping based on user input Pin
abollmeyer6-May-12 4:08
abollmeyer6-May-12 4:08 
AnswerRe: Looping based on user input Pin
Richard MacCutchan6-May-12 4:21
mveRichard MacCutchan6-May-12 4:21 
NewsN Queen algorithm design Pin
ShomaL University of AMOL5-May-12 22:45
ShomaL University of AMOL5-May-12 22:45 
AnswerRe: N Queen algorithm design Pin
Sandeep Mewara5-May-12 23:21
mveSandeep Mewara5-May-12 23:21 
GeneralRe: N Queen algorithm design Pin
Richard MacCutchan6-May-12 1:38
mveRichard MacCutchan6-May-12 1:38 
GeneralMy Vote of 1 PinPopular
Keith Barrow6-May-12 2:30
professionalKeith Barrow6-May-12 2:30 
GeneralRe: N Queen algorithm design Pin
PIEBALDconsult6-May-12 5:35
mvePIEBALDconsult6-May-12 5:35 
QuestionImage Encryption Pin
Danial C5-May-12 21:41
Danial C5-May-12 21:41 
AnswerRe: Image Encryption Pin
Sandeep Mewara5-May-12 23:24
mveSandeep Mewara5-May-12 23:24 
QuestionProblems with PathGeometry Pin
gabriel1235-May-12 18:28
gabriel1235-May-12 18:28 
AnswerRe: Problems with PathGeometry Pin
Sandeep Mewara6-May-12 1:23
mveSandeep Mewara6-May-12 1:23 
Questionchoosing a instalation directory fo aplications Pin
smartradio5-May-12 7:48
smartradio5-May-12 7:48 

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.