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:314732 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4