in reply to Re^5: OO Getters/Setters
in thread OO Getters/Setters
Accessors/mutators, by definition, provide direct access to the underlieing attributes. Since Perl is a dynamically typed language, that means doing any sort of validation on the data makes it something other than an accessor/mutator.
Pedantry such as this seems useless to me. If the object's interface says the only way to access an attribute is by using method foo, then for all intents and purposes, foo is an accessor. Believing anything else pierces the veil of encapsulation and defeats one of the main purposes of object orientation.
Ah, but now I'm into the fray... Quick! What's a "block structured language" and why is C not one of them? For bonus points, how does the fact that C is not block structured affect your ability to write useful applications?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: OO Getters/Setters
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 |