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? Why do I have to set a cfinvokeargument to pass a form into
the CFC if I know that the form will exist for the CFC if it exists on the
page. Everything about that particular CFC says forms, so why do I have to
do extra work to use what the CFC was created to handle.
A CFC is part of a page environment. Do you pass in application, session and
client information to a CFC? No, because you know it exists. Why is it
different for Form and/or CGI information?

> > into the DB. I'm sure that a CFC depending on environmental data (CGI,
> Form,
> > etc.) rather than explicitly passing that data in is a violation of some
> > rules somewhere.
>  yeah it is...i think even Forta's intro to CFCs calls this a no no.
> But thats more from the standpoint that it hampers reusability. In our
> enviroment (as whacky as it is) this would be a BIG no no since Form
> data is replicated to URL data and passed to the same page on
> subsequent calls.
> 
> 
> Adam H
> 
> > But then again, I do some strange things with CFCs.
> > Take a form that posts it's data to a database. The CFC that does the
> work
> > for that form will not have any arguments. It's assumed that the form
> scope
> > exists and I test the variables I want inside the CFC before I enter
> then
> > into the DB. I'm sure that a CFC depending on environmental data (CGI,
> Form,
> > etc.) rather than explicitly passing that data in is a violation of some
> > rules somewhere.
> >
> > Actually, the same goes for my logging CFC which assumes that there will
> be
> > a CGI scope with data for it to use.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware: a new and convenient web-based time tracking application. Start 
tracking and documenting hours spent on a project or with a client with Logware 
today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190857
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