What if WireBox providers also decorated?

So, I’m digging the WireBox providers, but I wanted to run an idea past you. Essentially, once I’ve injected the provider in I access the object it is providing like so:

What if we simplified things a bit more and allowed the provider to decorate the target objects methods by adding an onMissingMethod that simply passed the arguments on to the method in the target object (after getting it, of course) Then it would look like so:


Obviously the provider would not be able to provide any THIS variables and would not be a suitable replacement for the target object in a use that was dependant on the object having the correct component path or target object’s metadata, but I would love simplifying the other 99% of my uses by allowing the provider object to directly proxy my method calls to the target.




Hmm, let’s develop the idea Brad, because then this breaks the provider pattern. So maybe we do something else to not mix it.

I do like it though. How about a virtual proxy object?

Luis F. Majano
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com