On Tue, Dec 1, 2009 at 2:03 PM, Ъñny-ߤÿ <[email protected]> wrote: > It would be awesome if one could dynamically extend a CFC rather than > having to hard-code the path to the CFC in which to extend. A possible > solution for this would be to add a parameter to the CreateObject() > that would allow one to enter in a path to a CFC in which to extend. > > i.e. - CreateObject("component", [path to CFC], [path to CFC to > extend])
Scala has the idea of per-instance trait "inheritance" which comes pretty close to what you're looking for. You can achieve the same thing in CF by using mixins - essentially merging two CFCs at runtime. I have a utility for this which I need to publish - I've shown it in talks at conferences... You essentially just structAppend() the THIS scopes and the VARIABLES scopes of the two CFC instances. You lose the ability to use super to get at the "parent" CFC (because you're not actually using inheritance) but now I think about it, I think I know how to handle that as well... -- Sean A Corfield -- (904) 302-SEAN Railo Technologies US -- http://getrailo.com/ An Architect's View -- http://corfield.org/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood -- Open BlueDragon Public Mailing List http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon mailing list - http://groups.google.com/group/openbd?hl=en !! save a network - please trim replies before posting !!
