In my CFCs that handle form submissions, I am doing validation at the start of the function by declaring what arguments are required and what type they should be. As such:
<cfarugment name="forename" type="string" required="true"/>
What I am also currently doing is checking the value when inserting into the database. As such:
INSERT INTO Person (Forename)
VALUES
(
<cfif structKeyExists(ARGUMENTS, 'Forename') AND Len(Trim(ARGUMENTS.Forename)) GT 0>
<cfqueryparam value="#ARGUMENTS.Forename#" cfsqltype="cf_sql_nvarchar">
<cfelse>
NULL
</cfif>
);
Is there any need to check that the argument value exists and its length when its already been declared that its a required value?
You also need to
and that's just off the top of my head.