> The cfstoredproc tag will return both queries regardless, you could
> construct the function to return one of the callers choosing, but from a
> simplistic approach returning both in either an array or a structure seems
> more useful. The point I was making was that you either reference them as:
> 
> function()[1] and function()[2]
> 
> or:
> 
> function().resultsetOne and function().resultsetTwo
> 
> one, the structure, exposes more about the function than the other, the
> array.

I understand but I feel like they both expose too much to the application. ;)

I usually prefer structs becauses they're more literate but by
"hiding" the resultsets in the CFC it doesn't matter whether you use
an array, struct or whatever.

I would do this: 
component
  private datasets = structNew();
  private isLoaded  = false;
  
  private function loadData()
    if not isLoaded
      sp
         result1
         result2
      /sp
      datasets.result1 = result1;
      datasets.result2 = result2;
      isLoaded = true;
    /if   
    return;
  /function 

  private function getResult1()
    loadData();    
    return datasets.result1;
  /function 
  
  private function getResult2()
    loadData();    
    return datasets.result2;
  /function 
/component


-- 
Marc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:197280
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

Reply via email to