If you don't own the object, you can't make the setter return a reference to
'this' either.  But yes, the odds of having the setters returning the
reference are higher than having the appropriate combined setter methods,
especially if the object was written by the same dev team with such use in
mind.  I still don't like it though.  It's not like using whitespace and
comments can't distinguish the set of updates as a cohesive group without
help.

Remind me not to work at MM.  Can't stand those damn "my way or the highway
people".  ;)

barneyb

PS: to save my inbox from burning up, yes, that's entirely in jest.

---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Sean A Corfield
> Sent: Friday, August 15, 2003 5:21 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] One line or two (was: CFC Persistance
>
>
> On Friday, Aug 15, 2003, at 16:15 US/Pacific, Barney Boisvert wrote:
> > I don't see chaining the setFirstName() and setLastName() methods as
> > making
> > the operation more atomic.  If you want atomic, write a new method,
> > called
> > setName(), which takes two parameters.
>
> You can't do that if you don't own the object! That's my point: if you
> get an API that has lots of setter/getter methods but you want to
> program as if the API was less granular, then method chaining is
> appropriate (of course, that presupposes that whoever wrote the API
> actually returns this anyway!).
>
> > Right or wrong, it's valid, and therefore perfectly acceptable to me,
> > as
> > long as you don't work on the same project as I do.  ; )
>
> Yeah, coz' if you worked on my projects, you'd have to follow my coding
> guidelines (and I *always* get to set coding guidelines on any projects
> I'm involved with).
>
> Sean A Corfield -- http://www.corfield.org/blog/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> ----------------------------------------------------------
> 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).
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003

----------------------------------------------------------
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).

Reply via email to