Hi,

Where does one draw the line between Property Get and Function? They both
do exactly the same thing, do they not?

When should I use Property Get, and when should I use Function?

Jamie

Re: Implement a read-only class memeber as a Function or a Property? by Mythran

Mythran
Fri Oct 07 12:34:06 CDT 2005


"James Pittman" <James_L_Pittman@raytheon.com> wrote in message
news:rUx1f.4$Kc6.1@bos-service2.ext.ray.com...
> Hi,
>
> Where does one draw the line between Property Get and Function? They both
> do exactly the same thing, do they not?
>
> When should I use Property Get, and when should I use Function?
>
> Jamie
>
>

I use a property get when I deem that it "could" be a read/write property,
but I want it to be read-only. I use methods/functions/subs when I want to
perform a specific action, not just get a value...

For example, if I want to get the color of an object, and I don't want it to
be settable, this would be a property. When I want to perform some heavy
calculations to retrieve a value, this would be a method (although, it
"could" be read-only property).

Mythran