Hi Josian,
Thanks for taking the trouble.
Yes, you are quite right that using CF_AddCircuits gives a performance hit,
which grows larger as the number of circuits grows. That is a pity, because
the idea of duplicating hard-coded circuit definitions in each ancestor is a
little repellent (sorry Hal), violating OAOO (OnceAndOnlyOnce) principle.
However, I must admit that I have stopped using CF_AddCircuits myself, and
am using Hal's original hard-coded and duplicated method.
Your idea of using a database to hold circuit definitions is very
interesting. It conforms to OAOO, and can probably be managed so that the
performance hit isn't increasing as circuits are added. I am reluctant,
though, to put this kind of basic logical configuration away in a database.
I would be worried about the consequences for
readability/comprehensibility/maintainability, etc. Still, it's worth
pondering.
The GOOD news is that I haven't found any performance hit by using CF_XFB.
It hides away the details of how XFB works, performing several tasks:
* copies input parameters to a single scope;
* translates two-part fuseactions into fully-qualified logical paths;
* invokes circuits definitions in the appropriate place;
* returns necessary values in a nice structure named "XFB" to clean up
further processing.
Hiding away these details makes your index.cfm a lot prettier, and less
intimidating, but it also makes it more robust, because you're not likely to
accidently mess up the XFB processes while editing your FuseBox.
So I won't be recommending CF_AddCircuits, but I think CF_XFB is prettier
and safer. It also means that ongoing changes the XFB can be incorporated
into a single tag, and then rolled-out with minimal pain.
>From: "josian" <[EMAIL PROTECTED]>
>Date: Wed, 09 May 2001 12:23:59 +0400
>
>Hi lee,
>
>Have worked on your tags addcircuits, allscopes...etc from bjork.net.
>It works very fine and simple to use.
>But there is a problem when i have many circuits. Its takes time to
>load the circuits at each circuit level via the <CF_ADDCIRCUITS>.
>
>I think that the application circuits is inversely proportional to
>application
>performance.
>
>So,it would not be more simple to define all the circuits in circuits.cfm
>rather
>than recursively define it?
>
>I tried an example and found that works better. Here is the code:
>
>circuits.cfm in root directory of app:
><CFQUERY NAME="cir" DATASOURCE="datasour">
>SELECT CIR_NAME, CIR_PATH
>FROM CIRCUITS
></CFQUERY>
>
....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists