Well you've run into the big problem with using ColdFusion and objects.  The
object instantiation speed in ColdFusion is unacceptably slow, when you get
up into a large number of objects.

The best solution to this problem that I've found is the IBO (iterating
business object).  Essentially, rather than instantiating a large number of
objects, you create a single object which has a struct of arrays to contain
the query data.

It takes a while to wrap your head around it, but it's well worth the
effort.

For more information do a search for Peter Bell ColdFusion IBO.  He's the
one that came up with the idea when he ran into the same problem.

-- Josh



-----Original Message-----
From: Donnie Carvajal [mailto:donnie.carva...@transformyx.com] 
Sent: Wednesday, March 25, 2009 12:56 PM
To: cf-talk
Subject: Multiple Record Queries and CFCs


I have been trying to write my applications using the 3 tiered method of
development, presentation layer, business logic layer and data access layer.
I am having trouble coming up with an efficient method of displaying
information returned in a query that has multiple records.  Correct me if
I'm wrong, but shouldn't all data be placed into an object based on a
component so that the business logic can massage the data and return valid
inforamtion based on business rules.  If I am correct that that means that I
should create an object for every record of the query before I display the
data.  Doing this slows down my web pages by 100-200% going from fractions
of a second to around 20 seconds for a query that returns 100 records.  All
of the examples that I have come across on the web run the query in the data
application layer and then in the presentation layer, loop over the query
and output the data straight from the query (i.e. #qEmployees.firstName#).
The problem I have with outputting the data straight from the query is that
I will have to have business logic in 2 places.  In the business logic
component and the data access component.

How are you (anyone who would like to reply) handling this scenario and
keeping the integrity of the business logic?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:320964
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to