|
Jaime, My line of thinking here is pretty simple, but i think it's in line with best practice in CF. If you simply need to display the data to the user (probably as a list), use cfquery, a ColdFusion query object. If your users need to work with the data, then go with business objects, DAO's, etc. The simple fact of the matter is that a user will not be able to edit 1000's of entities at the same time. I see the usefulness of an object most clearly when you need to both maintain state and manipulate the data, during an editing operation for instance. And i don't see the possibility of needing to instantiate hundreds of objects in one go unless you're working with data, specifically a list of records. As far as your service layer goes, well, you're probably going to instantiate that and cache it in application scope, using lazy loading wherever possible. Practically, if you've got 100's of objects in your service layer, i'm pretty sure they won't all be needed on the first page load. Another possible way of minimizing the overhead of object creation is to represent the data packets only as an array of structs if you're more comfortable with that rather than a query object, and populating a full blown business object as necessary from the array of structs. Translating that to the world of transfer, at it's current level, means to me that transfer isn't well suited to display lists, for instance. Better to use your own gateway for that and return a query object, possibly caching it with your own mechanism if needed. Or use the new "Transfer Query Language" feature Mark is working on instead of your own gateway. I'm sure your use cases are more complex than i've represented them here talking about lists and edit operations, but as far as i know, this is the general approach to use in CF for performance reasons. Jaime Metcher 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] How many objects is too many? Jaime Metcher
- Re: [CFCDEV] How many objects is too many? Nando
- RE: [CFCDEV] How many objects is too many? Matthew Drayer
- Re: [CFCDEV] How many objects is too many? Mark Mandel
- RE: [CFCDEV] How many objects is too many? Matthew Drayer
- RE: [CFCDEV] How many objects is too many? Jaime Metcher
- Re: [CFCDEV] How many objects is too many? Mark Mandel
- RE: [CFCDEV] How many objects is too many? Matthew Drayer
- RE: [CFCDEV] How many objects is too many? Matthew Drayer
- Re: [CFCDEV] How many objects is too many? Sammy Larbi
- Re: [CFCDEV] How many objects is too many? Teddy Payne
- RE: [CFCDEV] How many objects is too many? Matthew Drayer

