On Sun, Mar 14, 2010 at 5:40 AM, denstar <[email protected]> wrote:
> I'd say a [g|s]etter could help with encapsulation, like say for with
> a DAO who's data field names change a lot (first_name, firstName,
> fname...).

Straw man. The DAO should map the column name to the business object
attribute. Nothing to do with get/set on a bean.

And there are situations - at the boundary between the OO model and
the procedural rendering code - where *some* getters are necessary
(unless you have a rendering method on your object and pass it a
parameterized string to perform replacements on - or some such).

The trouble is, if people start out from the position of
"encapsulation = add get/set for every property", they've already
completely broken encapsulation. If instead they start out from the
position of no get/set methods and only add them as external usage
seems to require them, they'll think more carefully about why they're
exposing the data.
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

-- 
You received this message because you are subscribed to the Google Groups 
"CFCDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cfcdev?hl=en.

Reply via email to