Click here to Skip to main content
16,012,316 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 8:13
professionalScott Dorman5-Jul-07 8:13 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 8:27
AEternal5-Jul-07 8:27 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 8:39
professionalScott Dorman5-Jul-07 8:39 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 8:47
AEternal5-Jul-07 8:47 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 9:02
professionalScott Dorman5-Jul-07 9:02 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
AEternal5-Jul-07 9:42
AEternal5-Jul-07 9:42 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Scott Dorman5-Jul-07 9:49
professionalScott Dorman5-Jul-07 9:49 
GeneralRe: Good practice or not? Defaulting member variables via properties Pin
Not Active5-Jul-07 9:58
mentorNot Active5-Jul-07 9:58 
Another point to add.

Your original method, initializing the member field to a valid value when accessed, is a technique called "lazy initialization" and is good for initializing objects that may have a heavy penalty such as in time or memory usage. For example, if your object contains a large collection that is not used in say 50% of the cases, you can put off initialization until it is needed. Or if that collection may take time to initialze, may be populated from a database, you can put it off until after the object has been created.


only two letters away from being an asset

QuestionUnRegistering Assemblies from GAC on the basis of public key? Pin
Mushtaque Nizamani5-Jul-07 4:18
Mushtaque Nizamani5-Jul-07 4:18 
AnswerRe: UnRegistering Assemblies from GAC on the basis of public key? Pin
Ilya Verbitskiy8-Jul-07 1:07
Ilya Verbitskiy8-Jul-07 1:07 
QuestionProblem with .net Pin
koolprasad20034-Jul-07 19:21
professionalkoolprasad20034-Jul-07 19:21 
AnswerRe: Problem with .net Pin
Sathesh Sakthivel5-Jul-07 16:38
Sathesh Sakthivel5-Jul-07 16:38 
GeneralRe: Problem with .net Pin
Paul Conrad6-Jul-07 15:33
professionalPaul Conrad6-Jul-07 15:33 
GeneralRe: Problem with .net Pin
Sathesh Sakthivel6-Jul-07 15:48
Sathesh Sakthivel6-Jul-07 15:48 
GeneralRe: Problem with .net Pin
Paul Conrad6-Jul-07 17:24
professionalPaul Conrad6-Jul-07 17:24 
Questionneed help wit code snippet Pin
neodeaths4-Jul-07 16:29
neodeaths4-Jul-07 16:29 
AnswerRe: need help wit code snippet Pin
Christian Graus4-Jul-07 17:12
protectorChristian Graus4-Jul-07 17:12 
QuestionReference to running application. Pin
Ylno4-Jul-07 6:39
Ylno4-Jul-07 6:39 
AnswerRe: Reference to running application. Pin
SHatchard5-Jul-07 0:27
SHatchard5-Jul-07 0:27 
QuestionSteps for???? Pin
PACO774-Jul-07 5:05
PACO774-Jul-07 5:05 
AnswerRe: Steps for???? Pin
originSH4-Jul-07 22:44
originSH4-Jul-07 22:44 
GeneralRe: Steps for???? Pin
PACO774-Jul-07 23:16
PACO774-Jul-07 23:16 
QuestionThreading/Paging in web services Pin
BobsAfro4-Jul-07 4:21
BobsAfro4-Jul-07 4:21 
QuestionCalling c++ unmanaged code from c++ Managed code Pin
AlamBakr3-Jul-07 12:25
AlamBakr3-Jul-07 12:25 
AnswerRe: Calling c++ unmanaged code from c++ Managed code Pin
Giorgi Dalakishvili3-Jul-07 20:38
mentorGiorgi Dalakishvili3-Jul-07 20:38 

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.