Re: Use of properties

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: SQL Update Question ....
    ... assets that have not yet been paid for. ... As an aside from the SQL part of your query, I would suggest not doing this. ... ASP already has a built in method for dealing with values ... little validation into your code. ...
    (microsoft.public.sqlserver.programming)
  • Re: Torque temperature compensation value?
    ... IMO, no, don't worry about it. ... If you were dealing with something HIGHLY ... technical in nature, and if the temperature excursions were quite large, ...
    (rec.autos.tech)
  • Re: FS: Tent
    ... Given where Nige live, his views, IMO, are highly relevant in dealing ... properly with "racist" attitudes in this country. ...
    (uk.rec.motorcycles)
  • Re: FS: Tent
    ... Given where Nige live, his views, IMO, are highly relevant in dealing ... properly with "racist" attitudes in this country. ...
    (uk.rec.motorcycles)
  • Re: Buying a used car
    ... Buying s/h is one situation where dealing with a broker is an advantage ... IMO. ...
    (uk.rec.driving)