Patrick McElhaney wrote: ------------------------ > > I was discussing the use of qry_ files with a friend... > > > > His opinion is that I should have three files (all qry_ > > files), and then put the conditional logic in my switch. > > The goal is code reuse, because each piece can be reused > > separate from the rest. > I agree.
What's your perspective on option two (treating qry_ files as if they are STORED PROC equivalents)? > > A third option that kind of melds the two together, would > > be to have another file (act_) that hold the conditional > > logic, and CFINCLUDES the relevant qry_ files. > I prefer to not have a fuse include another fuse and would > rather put the if statement in the cfswitch. The advantage > of having all of the code just beneath the surface seems to > outweigh the disadvantage of a long <cfswitch>. (Though, > I found another way to avoid the long <cfswitch>: > http://www.meta-magic.com/cgi-bin/fusewiki?FaFiles) > In most cases, I have four separate fuseactions: > - addRecordForm > - editRecordForm > - insertRecord > - updateRecord > > The cool thing about Fusebox is that I don't need a lot of > extra code to do that. The fuse files will be the same > regardless so all I need to do is have each fuseaction > include the appropriate fuses. This way I can avoid the > if statement altogether and the code is easier to follow. You forgot the 'listRecords' action. ;) For simple circuits, this is perfectly acceptable, and I do it exactly the same as you. But simple isn't always the case. I HAVE to have an if statement, because it's possible that my secondary record will fluctuate between being and not being present throughout the life of the primary record. cheers, barneyb --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.363 / Virus Database: 201 - Release Date: 5/21/2002 ==^================================================================ This email was sent to: [email protected] EASY UNSUBSCRIBE click here: http://topica.com/u/?bUrFMa.bV0Kx9 Or send an email to: [EMAIL PROTECTED] T O P I C A -- Register now to manage your mail! http://www.topica.com/partner/tag02/register ==^================================================================
