I think using argumentCollection is a completely valid way of doing
things. I use it all the time. Why write everything out when you can do
things like argumentCollection=form or argumentCollection=url? You'll
also find it in my code generator whereby I turn a query row into a
struct and init a new bean using argumentCollection. Suffice it to say
I use it wherever I can. I think it does a couple of beneficial things,
the primary being that when your arguments change you don't need to go
around updating your function calls. The second is, it makes handling
empty values easier. For instance, let's say you were passing a full
name you might say
user.init(firstName=firstName,mi=mi,lastName=lastName). However, how do
you handle the middle initial (mi) if it isn't defined because it is
not required. You could pass an empty string and code your function to
check for that, or you could just use argumentCollection. This is
actually a poor example, since it works better for numeric and other
types where, if you type check your arguments as you should, you can't
use empty string as a null equivalent....but I think you get my drift.-- Brian Rinaldi blog - http://www.remotesynthesis.com/blog ColdFusion Open Source List- http://www.remotesynthesis.com/cfopensourcelist Boston CFUG - http://www.bostoncfug.org Adobe Community Expert - http://www.adobe.com/communities/experts/members/brian_rinaldi.html CFDJ Editorial Board - http://coldfusion.sys-con.com/general/editboard.htm Dave Watts wrote:
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm CFCDev is supported by: Katapult Media, Inc. We are cool code geeks looking for fun projects to rock! www.katapultmedia.com An archive of the CFCDev list is available at www.mail-archive.com/[email protected] |
- [CFCDEV] ArgumentCollection Phillip Senn
- Re: [CFCDEV] ArgumentCollection Sammy Larbi
- RE: [CFCDEV] ArgumentCollection Dave Watts
- Re: [CFCDEV] ArgumentCollection Brian Rinaldi
- Re: [CFCDEV] ArgumentCollection Barry Beattie
- Re: [CFCDEV] ArgumentCollection Nando
- Re: [CFCDEV] ArgumentCollection Aaron DC
- Re: [CFCDEV] ArgumentCollection Sammy Larbi
- Re: [CFCDEV] ArgumentCollection Sammy Larbi
