By Peter Bell

Critical Error in LightWire - Patch Available

Thanks Martin for catching the critical lack of a var scoping on a couple of variables in LightWire. While I've been using the unpatched version on over 40 projects without issue, under load (creating lots of transient objects) this could be a real problem, so please update your LightWire.cfc and BaseConfigObject.cfc either from the svn repo (or in svn go to http://svn.riaforge.org/lightwire) or by downloading the latest zip file.

The ColdBox team are aware of the issue, so you may see a separate patch directly from them. Both versions include the autowiring code added by Luis, so you should be able to use either version with Coldbox.

Comments
Thanks for the quick fix Peter!
# Posted By Ernst van der Linden | 3/5/08 9:21 AM
Hi peter,

We are just starting to work with LightWire. We are curious why most of the arguments in BaseConfigObject.cfc are not scoped. Is there a particular reason for this?
# Posted By TJ Downes | 5/30/08 5:38 PM
I go back and forth. Scoping arguments and variables is something I can't quite decide on. It is more clearlyt documenting and may have the small benefit of not having to check multiple scopes (and the bigger one of there being no chance of pulling from the wrong scope if there is a precedence issue), but I also find it more visual noise when reading the code, so I'm not sure whether I like explicitly scoping stuff or not.

Right now I alternate :-)
# Posted By Peter Bell | 5/30/08 5:42 PM
Thanks Peter. We've had some problems with lack of scoping in the past, so I think we will scope the CFC since there aren't any issues doing so.
# Posted By TJ Downes | 5/31/08 2:21 PM
Probably not a bad idea for a framework. Let me know when you do it - if you send me over a copy I may merge the changes back in so you can use the core code and still have the scoping. FYI, should be some more features over the summer. Have been meaning to add AOP for a while now, but I haven't had a free weekend.
# Posted By Peter Bell | 6/1/08 10:40 AM
Hi Peter,

I would like to start using Lightwire in our home grown framework. I currently have a lighter version which is currently built into my framework but believe it is probably a better idea to use a more standard community driven technology for these purposes. Thanks to Kevan Stannard (creator of NSTree) for bringing LightWire to my attention a few months ago.

I want to connect to LightWire via a plug-in architecture which allows us more flexibility to switch DI Engines from project to project depending on the requirements. Considering I am not very familiar with LightWire, Could you please offer some direction? Do you have an API document? Or what in your opinion is the cleanest and simplest way to bridge the two (LightWire and homegrown framework) quickly.

Please feel free to send me a direct e-mail.
h.grant [AT] hgitc [DOT] com

Thanks you.
# Posted By Hussein Grant | 11/1/08 3:47 PM
@Hussein,

You might want to have a look at what Luis Majano and the team have done with ColdBox. They have a plug in architecture for Dependency Injection that allows for either ColdSpring and LightWire to be used. Their code in open source and might give you a good idea about how to write something that would allow you to plug and play between multiple DI engines.
# Posted By Peter Bell | 11/2/08 3:48 AM
Sounds like a good idea. I'll have a look at ColdBox then.

Thanks Peter.
# Posted By Hussein Grant | 11/2/08 12:30 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.