Re: Use of properties
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Wed, 25 Oct 2006 05:13:46 +0100
fallenidol <fallenidol@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
yep, they would need to do some validation etc on occaision. i guess i meant
that if a property is over 10-20 lines...doing alot of validation or dealing
with big obects that can generate errors...then it should probably be a
method rather than a property
Doing a lot of validation? Not a problem, IMO.
Dealing with big objects? Not a problem, IMO.
Possibly generating errors? Not a problem, IMO - so long as it's
documented.
There's a vague expectation that property access should usually be
"pretty fast", and properties should usually be orthogonal (so changing
one property shouldn't usually change another - unless one is read-only
and solely calculated from others, eg Area from Width and Height).
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Use of properties
- From: Paul Mcilreavy
- Re: Use of properties
- From: Marina Levit [MVP]
- Re: Use of properties
- From: fallenidol
- Use of properties
- Prev by Date: Re: Use of properties
- Next by Date: Re: Beginning GUI
- Previous by thread: Re: Use of properties
- Next by thread: Re: Use of properties
- Index(es):
Relevant Pages
|