Managed Hosting



Thor - a different kind of CFC validation
Project Home External Project Link Contact Project

Author: John Mason (All RIAForge projects by this author)
Last Updated: December 6, 2009 2:42 AM
Version: 1.0.5
Views: 22,402
Downloads: 1,648
License: MIT


Data validation is one of the most important operations of any application because it prevents malformed or bad data from getting into the system. The problem is it can be a pain to manage and maintain. Thor is designed to make this process easier.

If you are looking for a data validation solution, you will find several options here on RIAForge. Thor is very different in how it manages and performs validation. Some of features that you will not find in other validators include:

- Explicit / Implicit Validations
- Global Validation
- Handle Server and client side validation with one set of validator libraries
- Specific and general error codes and flexibility to do internationalization
- Field name mapping
- Validator/mapping/error code importing by CFC or XML
- Validator list reporting
- Fields not required option
- On-the-fly validation
- Logging
- Can also handle client-side validation

All this in one CFC and some library files. There is no underlining database and Thor is framework agnostic.

The zip contains the core Thor component, several validator libraries, documentation and several examples. The idea of Thor is to make server side validation stronger and yet easier to manage and maintain. As an example, there is included with the project a pretty extensive library for postal codes and phone numbers which takes a lot of the guess work out of those items.

An important note is that Thor doesn't directly deal with SQL injection or XSS attacks, there is another project I maintain that does help with those attack vectors called Portcullis and it's at http://portcullis.riaforge.org


Thor is unique in that it is supported under a wide range of ColdFusion servers.
- ColdFusion 9
- ColdFusion 8
- ColdFusion 7
- Railo 3
- Open BD

jQuery is optional if you want Thor to also handle client-side validation.

You can use Thor with Coldspring, Lightwire or without any dependency injection framework. Again, it is framework agnostic.