I'm working on a validation system for Transfer (but the idea would probably
port to other kinds of objects) that has a generic Validator class to handle
common needs like required fields, field length, type, etc. But you can then
define custom validation methods as well, which a subclass of Validator
would implement and which would be specific to a particular kind of object
(say, Order). The Validator will run the common and custom methods based on
an XML file which defines the validation rules. As a bonus, I am trying to
make it also able to generate client-side JavaScript (with an extensible
implementation so that it can handle any JavaScript library such as jQuery,
prototype, etc.) from the same XML. Which will allow you to define the rules
once and have them applied on the client and on the server. If I can get it
working acceptably I'll probably blog about it and/or post it to RIAForge.

On 10/8/07, Robert Rawlins - Think Blue <[EMAIL PROTECTED]>
wrote:
>
> Ah I see!,
>
> I hadn't considered the ramifications of the more complex validation, like
> you say, those that involve cross checks between objects and database
> calls,
> these would certainly be more difficult to implement using AOP or a
> generic
> class. I understand your thinking here completely.
>
> I have just started reading an article about a Validation framework built
> in
> JAVA which uses Spring and AOP, the idea being that you can implement a
> blanket validation process for these more 'trivial' tasks and data
> comparisons using AOP, which helps save development time, and then in the
> underlying model and business logic you can manually build these more
> complex validation checks.
>
> I think that building a system which allows space for both may work well,
> as
> it leverages the power of the framework to free up time doing the more
> trivial tasks and at least ensures a basic level of volition across the
> entire application, yet allows you to then extend that with non AOP
> business
> logic validation for the more complex data?
>
> Thanks again Brian, I hadn't considered those more complex validation
> problems,
>
> Rob
>
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290598
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