This sounds VERY similar my SimpleNesting concept. (I've
pretty much given up on the idea, but read on.)
http://www.meta-magic.com/cgi-bin/fusewiki?SimpleNesting
It DOES allow you to call fuseactions in another circuit,
but only if that circuit is a descendant. Theoretically,
you could call a fuseaction from a circuit outside the
calling circuit's structure, by allowing XFA's to be
inherited from above. However, I've found that isn't
always practical.
Before I had always accepted the constraint of only setting
XFAs that point to circuits at or below the circuit in
which they're set, because I figured otherwise the circuit
would not be truly encapsulated. I never liked the idea of
having to mess with the code of a nested circuit so that
it would fit in the application.
At this point, I think I've come to the conclusion that a
circuit doesn't have to be perfectly encapsulated. I still
think that the statement that nested circuits can
literally be dragged and dropped into an application is
terribly misleading, but I'm okay with the fact that it's
not quite that easy.
The other thing that always bugged me about how nesting
works is the fact the idea that each circuit functions as
a stand-alone. I think I've finally seen the light, however.
There is no point in unit-testing a circuit by calling its
own index.cfm rather than calling the home circuit. However, it
does make sense to unit test a circuit in an environment
where the home circuit isn't available. In other words, it
makes sense to test each circuit before you put them all
together. (Duh! That's what unit testing's all about! If you
need me, I'll be in the corner with my big pointy hat.)
I also never understood why each circuit had to be given
its own circuits.cfm so that unit testing would be possible.
At this point, I think its good to unit test a circuit
independently, but it's not necessary to give it its own
circuits.cfm. Calls to outside circuits will fail, but
that's irrelevant, because it's a unit test. [Note: Maybe
it would be a good idea to screen dump the attributes scope
when a prefix isn't found in circuits.cfm. That would be
great for unit testing.]
In essence, Hal's nesting method is nowhere near as plug
and play as he claims, but nevertheless it's worthwhile.
In the meantime, I'm working on another idea that's a
lot simpler, but reduces a lot of the anxiety with about
circuits.cfm.
Patrick
> -----Original Message-----
> From: Ken Beard [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 25, 2001 7:13 PM
> To: Fusebox
> Subject: cf_fuseactionPrefix - New Nesting Idea!
>
>
> Hey somebody come back to me on this one.. I think i just made a really
> cool custom tag that accomplishes what circuits.cfm and nesting.cfm are
> doing, but with less hassle.
>
> The problem circuits/nesting are trying to defeat is that when you plug a
> circuit into an app, you have to go in and change the fuseaction prefixes
> in the xfa's. Instead of the circuits/nesting solution which
> requires you
> to alter the nesting.cfm file whenever you plug in circuits, you
> could set
> a variable named fuseactionPrefix at the top of the index and just output
> that each time you're setting an XFA like <cfset
> xfa.edit="#fuseactionprefix#.edit">.
> I just wrote a custom tag I'm tenatively naming cf_fuseactionPrefix which
> would automatically set this variable. Just run this custom tag
> at the top
> of every index.cfm in your application. The code for this tag is
> as follows:
>
> <cfparam name="attributes.defaultFuseaction" default="">
> <cfparam name="caller.heirarchyLevel" default="0">
> <cfscript>
> // code for fuseaction prefix
> caller.heirarchyLevel=caller.heirarchyLevel+1;
> caller.fuseactionPrefix="";
> for(i=1;i lte (caller.heirarchyLevel-1);i=i+1){
>
> caller.fuseactionPrefix=listappend(caller.fuseactionPrefix,listget
> at(caller.attributes.fuseaction,i,"."),".");
> }
>
> // code for defaulting the fuseaction.
> if(listlen(caller.attributes.fuseaction,".") lt caller.heirarchyLevel){
>
> caller.attributes.fuseaction=listappend(caller.attributes.fuseacti
> on,attributes.defaultfuseaction,".");
> }
> </cfscript>
>
> Just run this tag at the top of each index and output
> #fuseactionPrefix# in
> your xfa's and you're set to plug and play.
>
> anybody with me here? seems like a really good idea, but i just
> thought of
> it as i was writing this message. I just tested it on one of my
> applications and it seems to work!
> I uploaded a zip file with this tag to my cfug site at
> http://www.tbcfug.org/index.cfm?fuseaction=files.details&file_id=58 You
> can go there to download it.
>
> p.s. i also made this tag handle defaulting the fuseaction at
> this level of
> the heirarchy.
>
> -----------------------------------------------------
> Ken Beard
> Manager, Application Development
> Stone Ground Solutions
> 5100 West Kennedy Blvd, Suite 430
> Tampa FL 33602
> 813.387.1235 voice
> 866.767.4051 toll free
> 813.387.1237 fax
> www.stoneground.com
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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