LightWire: Paul Marcotte on the new "mixin" tag
One of the differentiators of LightWire is the concept of "mixin injection". It could more properly be called generic setter injection and the idea is to provide the benefits of setter injection (the ability to handle circular dependencies) without having to clutter up your classes with a bunch of setters that you're never actually supposed to call.
Paul has added a tag to allow you to describe your mixin injections using an XML config file. Check out his posting for more information.



Are you saying that the mixin tag, will actualy inject a setter method into my bean, and then call on it?
Luis
I am going over the mixin injection format you have on lightwire, and it only injects on the variables scope. What if I want to do a mixing injection on the variables.instance scope? How would that work?
Is there a way to tell it on which scope to mix it in? Would this be useful?
Maye its me, but I mostly have my dependecies on a variables.instance scope. What do you think?
I think most if not all DI frameworks inject both properties and beans into the variables scope. If you wanted to change how that worked, I'd create a cfc called "MyLightWire.cfc" that extends LightWire.cfc. Then look for the method that does the mixin injection, make a copy of it in your cfc and change where it saves the variables to (either for everything or using some kind of logic). Should be a 5 minute job, and if you happen to do it and it works out for you, please let me know if you blog about it as I'd love to point to that. I always love when someone hacks something interesting with something I was involved in :->
http://www.oxalto.co.uk/images/pages/pb.jpg
http://www.pbell.com/atom/atom.cfm