By Peter Bell

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.

Comments
Peter,

Are you saying that the mixin tag, will actualy inject a setter method into my bean, and then call on it?

Luis
# Posted By Luis Majano | 6/27/07 5:53 PM
Hi Peter,

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?
# Posted By Luis Majano | 6/27/07 6:50 PM
Hi Luis,

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 :->
# Posted By Peter Bell | 6/28/07 7:59 AM
Aghh.. What is there that damn authentication window coming up on your site? makes it a pain in the arse to browse!
# Posted By TK | 6/28/07 11:47 AM
Not seeing that - could you elaborate?
# Posted By Peter Bell | 6/28/07 11:56 AM
Better than that, here's a screenshot..
http://www.oxalto.co.uk/images/pages/pb.jpg
# Posted By TK | 7/2/07 4:36 AM
PS - just tested, doesn't trigger in IE7, just firefox
# Posted By TK | 7/2/07 4:38 AM
That is really strange - I've never got that window and can't figure out what would be causing it. Running IIS using same settings I use for most of my other sites and I've never had a report about this before. Let me know if you have any ideas what might be causing it . . .
# Posted By Peter Bell | 7/2/07 6:30 AM
I think it may be this:
http://www.pbell.com/atom/atom.cfm
# Posted By TK | 7/2/07 7:40 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.