troy knapp - 2012-11-12 20:34:33
I heard what Micheal was saying @ around 26minutes about adding a method to an existing object, and it's something that I've wanted for at least a year.
I've never used Groovy or any other language that allowed for this type of dynamic scripting, but I've wanted it many times. I looked for good methods to add methods to existing classes, and couldn't find one... other then by modifying the existing code that instantiates the object.
My most simple use case that I've ran into occurs when I'm using an open source CMS, that is still live and being developed. I have, wanted to be able to add methods to core classes to add functionality without having to worry about my changes being written over when I upgrade. Ideally, just changing the core would be the best option, but I don't want my code to disappear after an update.
Another use case that I've wanted it for in the past is when I want to switch my site into a development mode and load in logging and tracing methods, but I don't want all that extra overhead in a, normal, production environment.
Just my two cents... when I heard Micheal talking about it I thought to myself "I'm not crazy!"