Just recently I did the first option and it was more from the stand point of I did not see any value to having a separate function for each need like this. Seems like there is not a huge difference between the 1st and 3rd, both use a CFIF to decide how the output of the function is going to be. One just takes the route of doing a different query for the IF and the ELSE then the other just uses one single query that then has the IF/ELSE work done within it. Or am I reading the first option incorrectly? In the past I did option two almost exclusively but when I was evaluating that path recently I decided I was ending up with quite a few functions that were more or less very similar to one another so some could be combined into one function with just some minor IF/ELSE logic.
On 12/18/05, Michael Dinowitz <[EMAIL PROTECTED]> wrote: > > This is more of a style question than anything else. Lets say you have a > CFC that will be doing all the work for an application. There is need for > two different queries. The first gets an ID based on a passed value. The > second uses the same table but returns the id as well as a name and does not > need a passed value. Now here's the style question: > Do you write one function that will return both pieces of data and > does a CFIF to see if a value was passed? > Do you do two functions with each one doing exactly what is needed? > Do you write a single function that has a CFIF with two totally > different queries? > > Not a killer question, but one of style that should be investigated. I'm > doing the third option as I want very tight data transfer but also fewer > functions. Of course, if someone has a really good argument for one of the > other styles I'll re-evaluate my decision. :) > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227249 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54