I have to agree on this.  The fusebox acts as a road map, and conditional
processing inside a fuse/case statement meets that goal a lot more clearly
than the additional page loads and stuff required to do the same processing.
It simply makes no sense to execute another call to the server just because
"we want to run a query or not".

I have some fuses that are up to 14 or 15 lines in length.  Those fuses do
some complex things, but NOT things that should be broken out into multiple
fuses.  They are still very easy to read.

Someone (I don't remember who) had a quote in their email signature, which I
have bastardized to suit my need on occasion:  "If it was hard to write, it
should be hard to read".  Well, not entirely, but the harder it is to write,
or the more complex the function, the more you might have to stare at it for
a few minutes in order to understand it.  Fusebox reduces the "stare"
factor, UNLESS you let it start running away with itself, and taking all
these wandering paths.

On a similar note, I have resigned to the fact that I am not going to simply
"understand" this "XFB" stuff at all, until I get a chance to have a course
with Mr. Helms (or another decent book on the subject), because I just don't
understand the complexity of it on the surface... and right now, I am to
busy to go below the surface.  Fusebox ("simple" fusebox) is working great
for me, and I continue to grab new "snippets" of ways to do things as I go
along.  But my days of "studying" fusebox and adding on to it for both
myself and my staff are over for now...  We must use what we have studied to
date to actually make some money, or we might as well start studying how to
flip a burger and lift up some fries at the same time.

Sorry if I sound a little confrontational, but lately it seems that there's
been a trend towards more and more complexity in fusebox that has been a
turnoff for me.  I am sure that once in the capable hands of a fusebox guru
like Helms, I'll be enlightened.  For now, I need both myself and my staff
to be the unenlightened crowd that still pumps out solid, reliable, and for
the most part maintainable code.

The short answer, DON'T BE AFRAID TO PUT CONDITIONAL PROCESSING IN YOUR
FUSEBOX.

.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Marc Funaro, President
Advantex Technical Consulting Services
5547 State Highway 12
Norwich, NY 13815
Phone:  607-336-6895
Fax: 801-383-4864
Internet: http://www.advantex.net
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

-----Original Message-----
From: lee borkman [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 09, 2001 9:54 AM
To: Fusebox
Subject: RE: Surveying the community


Now I think this is taking things a little too far.  The main purpose of
FuseBox is to make things easier and quicker to
write/understand/maintain/debug/enhance.

Your first "if-boxed-in" solution looks just fine to me.  I can see what's
going on, and more importantly, my juniors won't resign en-masse when asked
to work with it.  Your solution "A", on the other hand...

Well, that's just my gut reaction.  Perhaps I can justify it...

ColdFusion's CFLOCATION is the nearest thing we have to a GOTO.  To be used
with caution.  When the location of the GOTO's jump is itself a variable, as
in Solution "A", then we have an indirect jump, which takes me back to
writing my first sequencer in 6502-assembler.  That's not a memory I want to
re-live ;-)

Go with the nicely structured conditional-inside-a-switch.  It satisfies all
of the goals for which FuseBox was invented.

[In terms of software complexity, the boxed-in solution has a structured
complexity of 3 (program + case + if).  Solution "A" has a structured
complexity of 4 (program + 3*case) PLUS an UNstructured complexity of 1
(goto).]

Many apologies for the lecturing.  I know it was meant to just be a survey
;-)

Lee.


>From: "Patrick McElhaney" <[EMAIL PROTECTED]>
>
>If boxed into a corner, I would do this:
>
><cfcase value="doSomething">
>   <cfinclude template="act_DoSomething.cfm">
>   <cfif isConditionTrue>
>     <cfinclude template="qry_aQuery.cfm">
>   </cfif>
></cfcase>
>
>However, depending on the problem, I would
>usually approach the problem a completely
>different way.
>
>A)
>Break the fuseaction into two parts.
>
><cfcase value="doSomething">
>   <cfset xfa.isTrue = "doQuery">
>   <cfset xfa.isFalse = "skipQuery">
>   <cfinclude template="act_DoSomething.cfm">
>   <cflocation url="#self#?fuseaction=#xfa.condition#">
></cfcase>
><cfcase value="doQuery">
>   <cfinclude template="qry_aQuery.cfm">
>   ...
></cfcase>
><cfcase value="skipQuery">
>   ...
></cfcase>
>
.....
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to