Re: Inheritance of constructors.
- From: A n g l e r <p|k|o|n|i|u|s|z@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jun 2008 17:09:44 +0100
> Avoiding
making fields public helps too :)
Bare in mind that was just for sake of example.
I'm also not sure where threading
comes into it particularly...
It just comes in the sense that you wouldn't like your data collection being modified while reading. In case of "reference by value" that's not a problem cos it never gets updated anyway - just remains stuck with an old collection unless you do something on your own, lol.
But yes, your point that the field is a just reference rather than
something which automatically keeps track of a different variable is
correct. I can't remember when I've ever wanted the latter behaviour
though.
Imagine a class which handles rendering at 15 frames a second. Now, imagine that you have a collection of objects it renders to screen or wherever you fancy. Do you really desire to inform the class that some objects are added/removed from the data collection? I'd rather have a memory-wise reference that assures the class would always see the updated collection. What's the point in copying reference values of let's say 1000 objects 15 times a second (provided collection changes so dynamically)?
Cheers
.
- Follow-Ups:
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- References:
- Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Re: Inheritance of constructors.
- From: A n g l e r
- Re: Inheritance of constructors.
- From: Jon Skeet [C# MVP]
- Inheritance of constructors.
- Prev by Date: csc or al
- Next by Date: Re: Get mouse global clicks without a hook
- Previous by thread: Re: Inheritance of constructors.
- Next by thread: Re: Inheritance of constructors.
- Index(es):
Relevant Pages
|