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

Reply via email to