> -----Original Message-----
> From: Sean Corfield [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 12 July 2007 2:21 AM
> To: CF-Talk
> Subject: Re: SURVEY RESULTS: Is ColdFusion OO?
>
>
> 2) simply use type="any" and allow any strategy object to be pass in -
> if it doesn't implement the right methods, you'll get a runtime error
>

Just musing about how to preserve some of the documentation benefits of
typing in the presence of duck-typing.

I guess if we stick to short methods (<20 lines) the set of methods required
to be implemented by duck-typed arguments is not too hard to work out just
by reading the method body.   In fact if we wanted to soup up the code
introspection I'd think this is something that could be determined
automatically by inspecting the CF parse tree.  Obviously we couldn't follow
the call tree as we don't know which implementation to look at until
runtime, but we could at least determine method names and number of
arguments.

Beyond that, there's still a need to document somewhere central the
semantics of each duck-typed method - it's all very well to know that a
method will take as an argument any object that implements a setID() method,
e.g., but it's important that the caller and implementor share a common
world view regarding what an ID is.  cfinterface or the abstract superclass
technique provides a place to put that documentation, and it would be nice
to have a documentation mechanism with no runtime impact that is similarly
structured and introspectable.

Jaime Metcher






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2. 
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS 

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