On Sat, May 5, 2012 at 8:41 AM, Travis <[email protected]> wrote:

> Are polymorphic arrays allowed in CFML?


Arrays specifically? Not sure what you mean, and not sure this is quite
what you're asking below. :-) But I may be misunderstanding.

Array elements are not typed, if that's what you mean.


> Let's say we have three
> components that extend one component... can we create arrays of type
> object


Well the array can hold anything, so sure.


> so that we can loop through all the methods of the child
> components?
>

I think you lost me.

The concept of automatic type promotion exists, meaning if Child extends
Parent and a method requres Parent as an argument, Child can be used.

As for looping over the methods you lose me there because you can do that
regardless of anything related to type.


>
> I know CFML supports polymorphism in that components can override
> methods of extended components.


Right you can override, you cannot overload.


> But I want to assign super-components
> to child-components


Really don't get what you mean here. You'll have to provide a concrete
example.


> and override them for true polymorphism.
>

It'd be helpful if you'd take a step back to what you're actually trying to
accomplish, because it could well be what you're trying to accomplish can
be achieved in a bunch of different (potentially much less complex) ways.
-- 
Matthew Woodward
[email protected]
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

-- 
online documentation: http://openbd.org/manual/
   google+ hints/tips: https://plus.google.com/115990347459711259462
     http://groups.google.com/group/openbd?hl=en

Reply via email to