>To draw a parallel, you wouldn't think twice about returning a >dollar value of "3000" from an Product.getValue() call. But >when you display that value, you'll likely want to add a currency >sign and maybe some place denotation, so it looks like "$3,000.00". >You obviously wouldn't want to put the formatting to add the >dollar sign, comma, and decimals in the getter for a price, >otherwise it's useless in calculations since it would be a >string and not a number.
Just for fun (and to maybe start another of those monumental back and forth flame war we know and love), may i suggest that you look up an article called "Why getter and setter methods are evil" by Allen Holub. A bit of a contrarian view point, but full of interesting thoughts. Consult a quality search engine. /t ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
