On Mon, 17 Jan 2005 18:07:50 -0500, Michael Dinowitz
<[EMAIL PROTECTED]> wrote:
> This is where I disagree with the whole OO approach and what people consider
> no nos. I know that the form processor CFC always processes a form. I know
> that a form will only be posted as a form, never as an URL. I know that the
> CFC will only be used in a place where a form will be posted to. Why should
> I do all the form variable validation outside the CFC that's supposed to
> handle the form?

Whilst a lot of people might think it strange / inappropriate to use a
CFC to process a form POST operation, if that's the single job it
does, I feel it's OK. However, there are "good" ways and "bad" ways to
actually implement it...

If your form action is formprocessor.cfc?method=handlePost and
handlePost() operates on arguments scope, I think that's just fine.

If your form action is a .cfm page that invokes a CFC method then,
yes, you absolutely should pass the form scope as an argument.

Either way, if the CFC has the responsibility of handling the POST
data then it should do the validation.

It's all about responsibilities and cohesiveness.

> A CFC is part of a page environment. Do you pass in application, session and
> client information to a CFC?

Yes, unless the CFC is specifically acting as a fa�ade for operations
on that scope.

I think it's a bit of a stretch to claim that a CFC is acting as a
fa�ade for form scope tho'...
-- 
Sean A Corfield -- http://www.corfield.org/
Team Fusebox -- http://www.fusebox.org/
Breeze Me! -- http://www.corfield.org/breezeme
Got Gmail? -- I have 5 invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190861
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to