Aaron,

I think your suggestion is a very good and practical one. Because I
don't know how we could achieve method overloading directly within CF
itself since by nature it is dynamic (though Sammy had some good
ideas), I think your suggestion is the next best thing. Now I just
have to decide if I want all of the methods in my service layer of if
I should put saveStruct() and saveObject() in my DAO whilst the
generic save() method alone is in my service like so:

<cffunction name="save" output="no" etc>
  <cfargument name="theThing" type="any" required="yes">
  <cfargument name="theBits" type="any" required="no">
  <cfargument name="theOhterBits" type="any" required="no">

  <cfif isStruct(arguments.theThing)>
     <cfreturn objectDAO.saveStruct(arguments.theThing)>
  <cfelseif isObject(arguments.theThing)>
     <!--- check arrayLen(arguments) etc --->
     <cfreturn objectDAO.saveObject(arguments.theThing)>
  <cfelse>
     etc
  </cfif>
</cffunction>

Thanks,
Aaron


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/cfcdev@cfczone.org

Reply via email to