That'd be a good use for it -- it's rather like how Tapestry's OO objects work. You could of course always store related variables of the cfc in structures within the this[] scope and then using something like the default getter / setter functions I described in my other email you could return either an individual element or a group of related elements as a structure -- or even return another cfc which is a property of the cfc called.
> I am only dabbling in CFCs but it seems sensible to me to > retrieve a > structure of related information using one getter, then > just accessing that. > But maybe I just don't "get" CFCs. Perhaps it's up to the > CFC to cache that > info so that endless database requests aren't required. > For example, the > first getSomething() could query the database for more > than just the one > requested field, and store the whole lot in a cache. Any > following > getSomethingElse() could grab the data from that cache. > Matthew Walker > Electric Sheep Web > http://www.electricsheep.co.nz/ > ----- Original Message ----- > From: "Thomas Chiverton" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Thursday, March 27, 2003 12:01 AM > Subject: CFCs - get'ers Vs. return object >> I'm just starting to write my first CFC in anger, as it >> were, and was > curious >> about what others were doing. >> Are people writing a number of of >> getX,getY,getName,get.... methods, each >> returning a string/numer and then using >> <cfobject component="com.locavista.location" >> name="objLocation"> >> <cfoutput>#objLocation.getName(156537)#</cfoutput> >> OR writing a single get that returns a query or custom >> object, and then > using >> <cfinvoke component="com.locavista.location" >> method="get" >> iLocId="156537" >> returnVariable="objLocation" > >> <cfoutput>#objLocation.description#</cfoutput> >> >> Obviously, no difference in output, but writing lots of >> get'ers is time >> consuming, though provides better abstraction from the >> datastore. >> Also, each getX will make a database query, so outputting >> a list of the >> objects will be much slower using the first method than >> the second, as I > see >> it. >> >> So I'm plumbing for doing it the 2nd way - is there any >> sort of consensous > on >> this ? >> -- >> Tom C >> "Land of the free, home of the brave... you have to be >> brave to live there > and >> enjoy the freedoms" >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > ~~~~~~~~~~~| > Archives: > http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 > Subscription: http://www.houseoffusion.com/cf_lists/index. > cfm?method=subscribe&forumid=4 > FAQ: http://www.thenetprofits.co.uk/coldfusion/faq > Your ad could be here. Monies from ads go to support these > lists and provide more resources for the community. > http://www.fusionauthority.com/ads.cfm > Unsubscribe: http://www.houseoffusion.com/cf_lists/uns > ubscribe.cfm?user=633.558.4 s. isaac dealey 954-776-0046 new epoch http://www.turnkey.to lead architect, tapestry cms http://products.turnkey.to tapestry api is opensource http://www.turnkey.to/tapi certified advanced coldfusion 5 developer http://www.macromedia.com/v1/handlers/index.cfm?ID=21816 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

