Holub's point is that the *automatic* creation of *public* getters and setters is a problem. It's not that they're somehow evil; it's that we should make sure that we can't let the object do whatever work we might be wanting the info for. It's a good point, but it's all too easily warped into "Don't use getters and setters."
Hal Helms See halhelms.com for classes in... Java for ColdFusion Programmers Fusebox 4 Mach-II OO Applications with CFCs -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nathan Dintenfass Sent: Thursday, September 11, 2003 5:18 PM To: [EMAIL PROTECTED] Subject: [CFCDev] Getters and Setters WAS: DB and OO question I got that same thing from the article, but that goes against everything the OO folks in CF-land (Sean, foremost among them) has been preaching. So, frankly, I'm confused as to what is being suggested here. Is the rule being espoused that getter and setter methods are only for "public" methods that an end-developer will use? I could understand that, but that's not what I'm reading on these posts and in Sean's blog. If I've got a Person and a PersonPersister (to use someone else's example), and I say something like: personPersisterInstance.savePerson(personInstance) Should the PersonPerister not call the getFirstName(), getLastName(), etc. methods from Person, much the way I would have the the PersonRender custom tag might do? I just KNOW that Sean isn't proposing public data members (personInstance.firstName), is he? ;) > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Brad Howerter > Sent: Thursday, September 11, 2003 1:44 PM > To: '[EMAIL PROTECTED]' > Subject: RE: [CFCDev] DB and OO question > > > I just read Holub's article. Applied to ColdFusion MX, I think it is > a good argument to encapsulate more of your data access within CFCs, > including writing methods to do display instead of retrieving values > to display on your own. Once you put the display methods in your > CFCs, then you can dispense with the setter/getter methods. Holub > says "Draw Thyself". > > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
