> why are you using a form validation CFC?

No specific reason for using a CFC, except that I can put all my form 
validation
routines into a single CFC easily enough.

My normal practice is to have a page submit back to itself (and even 
with a CFC
or two involved, I still do that), but I've been trying to follow the 
basic reason
it seems for using CFC's at all, which seems to be separating logic from 
presentation,
the same way I'm now using stylesheets more extensively.

I can certainly use a cfinclude, but then, unless I use some cfswitch to 
differentiate
routines, I'll have to have a lot of cfincludes as opposed to just one 
CFC with
various methods.

Why does having a "form_validation.cfc" seem awkward?

I'm considering taking the approach of making the appropriate email 
routines that
follow validation routines, "children" (I think that's the term) of the 
validation routines
so there's only one call from the calling page and then the data flows 
through the
process of validation and emailing, then returns to the calling page 
only once.
Thoughts on that?

As far as using the variables scope in cfc's, I typically don't if the 
data in being used
on in that specific cfc.  I just use the arguments scope... less typing.

More thoughts and perspectives?

Thanks,

Rick




Mike Chabot wrote:
> Taking a step back, why are you using a form validation CFC? Your goal
> is that you want to validate a form then send an email. So the simple
> way to do this is to post the form to itself, then at the top of the
> page detect whether the page is posted to itself, run it through some
> validation checks and then send the email. Why not just put the
> validation code right in the page or in a cfinclude, or in a custom
> tag, or in a UDF library. The concept of having a
> "form_validation.cfc" seems awkward. Is there a specific reason that
> you are doing this?
>
> To more specifically answer your question, avoid the variables scope
> inside of a CFC if you can. You can use that, but it is generally
> considered bad design and it can lead to problems that are hard to
> troubleshoot.
>
> -Mike Chabot
>
>
>   

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314724
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to