in reply to Re: Re: OO Getters/Setters
in thread OO Getters/Setters
With the direct access, I have no control over the field.
In Perl you do, via tied scalars in the internal attributes. I don't think this method is common, but it can be done.
With the accessor, I have complete control over the field.
If you're doing something more complex than setting or getting an attribute (no validation, etc.), then it's not a true accessor or mutator.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: OO Getters/Setters
by dreadpiratepeter (Priest) on Dec 31, 2003 at 15:29 UTC | |
by hardburn (Abbot) on Dec 31, 2003 at 15:43 UTC | |
by duff (Parson) on Dec 31, 2003 at 17:01 UTC | |
by hardburn (Abbot) on Dec 31, 2003 at 17:20 UTC | |
by tilly (Archbishop) on Dec 31, 2003 at 22:11 UTC | |
by duff (Parson) on Dec 31, 2003 at 18:05 UTC | |
by linux454 (Pilgrim) on Jan 02, 2004 at 15:56 UTC | |
by hardburn (Abbot) on Jan 02, 2004 at 16:27 UTC | |
by linux454 (Pilgrim) on Jan 02, 2004 at 20:00 UTC | |
|