>
>For the most part I agree.
>
>Here's a situation we have (and I'm not saying it's a good 
>approach, but
>it's a live instance of <cfinclude> in a CFC... I'm all ears as to how
>better to do it!)
>

*snip*

Would it be possible to have these CFC's extending a base CFC. Have methods
in the base CFC that contain the <cfquery> tag and runs the queries for
get(), add() etc. and have those methods containing the common cfqueryparam
logic. Then you can pass in the start of the SQL statement from the get(),
add() etc. in the extending CFCs. If they're already extending something,
you could acheive the same thing using composition and passing the start of
SQL statement and other info in.


>Second situation.
>
>We have a cfml.cfc, which ahsd a bunch of function versions of 
>CFML tags
>(cfAbort(), cfDump() and such like: we've all done this).
>
>We've also got a cfQuery() function, which maps as closely to <cfquery>
>as I can get it, including the <cfqueryparam> support.
>
>Now it turns out that there are 30 (I think... Going from memory here)
>mutulaly exclusive combinations of attributes for <cfquery>.  
>And thanks
>to CF rocking so much, each of these combos has to be reflected in a
>hunge sequence of conditional statements identifying which attributes
>have been passed in, and accordingly put together a separate 
><cfquery />
>block for each of them.  And within each of those thirty <cfquery>
>blocks, there is the <cfqueryparam>0-handling code.  And the
><cfqueryparam> handling code is itself another series of conditonals to
>determine which attributes have been passed to each query param.
>

I think the same basic principle as above could be applied to this scenario
too.

I'm not sure whether it would be any _better_ because I think that's too
subjective a thing to be sure about, but it certainly seems possible to
solve this using OO principles.

That is of course without looking at the code and actually trying to
implement the above which may well be full of holes :)

Spike

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to