Jim,
As no-one more experienced has jumped in yet, I will give you my thoughts.
I would use formaction.cfm to call your CFC method.
In order to post to your CFC method, you would have to make it
"remote", which means anyone could call the method directly.
Certainly, there are conditions where that would make sense. Until
you find specific cases for that, however, I would recommend that
your methods remain "public" and you call them from your .cfm files.
The other consideration is that you don't want to tightly couple your
form structure to you CFC method. Put another way, you want to be
able to rename form fields without having to change the syntax of
your CFC method. If you use cfinvoke, you could pass in arguments
using different names than your form field names.
This also provides the flexibility of calling more than one method if
you need to do so as well as the ability to create a complex variable
to pass into the method.
All of this can help keep a nice API for your CFC that doesn't have
to be constrained by the limitations of forms, but is still very easy
to deal with.
Hope that helps!
Steve Bryant
918-449-9440
Bryant Web Consulting LLC
http://www.BryantWebConsulting.com/
http://steve.coldfusionjournal.com/
At 02:01 PM 2/15/2007, Jim Cassata wrote:
Hi all, As I am moving my single tier CF app (hey, that was how the
training was done back then ;) to be multi-tier, I have a question
re forms and CFCs. In my app, I have a form.cfm page and the form
action is the formaction.cfm. The question I have is should I use
the CFC as the form action or use a cfinvoke from the
formaction.cfm. I have seen a how-to-do-this in livedocs but not a
whether-I-should-do-this. It seems that all things being equal I
could do away with quite a few formaction.cfm pages and consolidate
into a few CFCs. Your thoughts? Thanks, Jim C
You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]