true I need to iterate through the superclasses... I honestly would
never do this sort of thing for anything except a published API.

Good idea about adding the functionality to component.cfc!

thanks,

Dave

>>> [EMAIL PROTECTED] 6/29/2004 2:52:11 PM >>>
What you've got there won't handle classes that extend
com.dross.MyClass.
You'll need to check the class of both supertypes and potentially
interfaces
as well (though not for this specific case).

I wouldn't try and throw the native CF exception, as that could well
change,
thereby breaking all your code with ClassNotFoundExceptions.  Those
exceptions should all be caught in development, because they're
programming
bugs.  Just use a custom type.

Finally, if you move that validation to a method in your root
component.cfc,
then all your classes will automatically inherit the ability to
validate
java arguments.  The method would just need the object and a
class/interface
name.

Other than that, I think you're on the right track, if validating the
type
of the passed object is of great import.  Personally, I'm happy to just
let
CF complain when I use an object in an inappropriate way, because it's
not
of the right type, rather than explicitly checking when it's passed. 
CF is
a loosely typed language, after all.

Cheers,
barneyb

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to