Regarding this.validate, I'm writing abstractly to refer to validating an object's data within the object as opposed to sending it out to a separate validation object. You won't find this in any manual.
Back when CFCs first came out I extensively researched how best to handle function libraries since I was creating a very high profile, high traffic, mission critical Web application. I was trying to make use of CFCs extensively because I saw that as the direction CF was headed and it was the hot new feature. My conclusion was that CFCs treated as function libraries incurred unnecessary overhead while offering no additional benefit over a pre-CFC function library. With CF8 things are different in that CFCs in CF8 are much faster, plus they play nice with technologies such as AJAX and Flex. Going back to your original question, you can pass the form structure into a CFC function if you want to. It still seems strange to me, but many decisions in CF come down to personal preference. -Mike Chabot On Sat, Nov 1, 2008 at 5:49 PM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > You're right, Mike... > > I'm just using the CFC as more of a function library, not so much from > an OOP standpoint. (I only learned to use CFC's effectively in the last > week or so :o) > > I'll have to dig into the "this.validate()" method a little more to > understand it. > I did see it discussed in the livedocs, but figured that would slow > things down > a little too much for now. > > Once I get CFC's down, I'll work on the OOP style more. > > Don't want overload my little rowboat with too much of a motor! > I still need a trolling motor, not a twin-engine! :o) > > Rick > > Mike Chabot wrote: >> Rick, >> Basic form validation is along the lines of "was the first name >> entered" and "is the length of the first name GT 0" are often specific >> to a single form in the site and don't benefit from being abstracted. >> >From an OOP standpoint, the object can be the page, the form, or a >> form field. A validation function is something that could be part of >> one of those objects. For example, if you consider your form to be an >> object, then a this.validate() method would be part of the form object >> and you wouldn't need to pass the form data en-mass to another CFC >> since you are staying within the same object. The question of how you >> pass the form scope to another CFC goes away and the problem is >> simplified. >> >> I would guess that what you have is more of a function library and >> that you are putting them into a CFC because they are similar code, >> not because you are practicing OOP. You can certainly do this if you >> think this makes your site easier to maintain. I'm making assumptions >> about what your validation code is doing and have no way of knowing >> what is best for your site, but hopefully I explained my "taking a >> step back" comment on whether it makes more sense to call >> Object2.validate(Object1.data) instead of calling >> Object1.validate(this) since taking the latter approach might nullify >> your question. >> >> -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:314741 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

