What is duck-typing and how is ColdFusion related?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
ColdFusion allows function arguments to be specified as having type
any. For this sort of argument, an arbitrary object can be passed in and method calls are bound dynamically at runtime. If an object does not implement a called method, a runtime exception is thrown which can be caught and handled gracefully. In ColdFusion 8, this can be picked up as a defined event onMissingMethod()rather than through an exception handler. An alternative argument type ofWEB-INF.cftags.componentrestricts the passed argument to be a ColdFusion Component (CFC), which provides better error messages should a non-object be passed in.http://en.wikipedia.org/wiki/Duck_typing#In_ColdFusion