By Peter Bell

LightWire 0.5 Released!

I finally got a couple of hours to port LightWire to using a config file. It adds one extra file to the project (a BaseConfigObject.cfc), but it makes for a much nicer interface for configuration and would make it trivial to add support for ColdSpring XML files for anyone who wanted to write a small script to loop through an XML file and call the appropriate config methods.

I have full support for constructor, setter and mixin injection and properties, and a nice clean programmatic interface in the config files. I think an enterprising person could also quite easily write a script to go through the config struct exposed by the bean calling getConfigStruct() and turning it into a ColdSpring XML file for easy export of programmatically generated config files as static XML files.

I have also written a little test bed which shows the basic operations of LightWire within a sample project along with the latest copy of LightWire. The one core DI thing still missing is support for using your own factories . I've just not had a use for this personally, but as a proof of concept I'll add optional code to the test harness you can use to use Transfer as a factory within LightWire. That should be in some time tonight if I get another hour to drop it in between paying projects.

The only other thing I see missing (other than AOP and remote bean proxies which I *will* be adding my own take on) is autowiring, which I'm just not into at all and so won't be bloating up the framework with all of the necessary introspection code to implement a solution that I just don't think is a good approach.

Oh, and there is one BIG thing that LightWire is SHAMELESSLY MISSING. It is the perfect kind of project for unit testing and it DOESN'T HAVE ANY TESTS :-< I've read the books, I've downloaded the framework, I understand the benefits, but somehow I'm just still not quite test infected. If any kind soul would be willing to contribute a couple of sample tests to show how they'd go about adding unit tests to this it'd be much appreciated :->

Check out the files in the Subversion repository at http://svn.riaforge.org/lightwire. Latest version is under trunk/LightWire0.5. Or you can download the enclosed zip file below (click on "download").

Comments
Peter, I normally use CFUnit, so I can't speak to the API of CFCUnit, but basically, you would just create a cfc, say lightwire_test.cfc, which would inherit from cfcunit (I'm assuming this is how it works, if it is anything like any xUnit framework I've messed with). Then, instead of playing around with and testing your code manually and incrementally, you would add tests for each bit of functionality in your lightwire_test.cfc.

I guess you probably "got" that already, so maybe if I've got some time later in the week I'll download the project and add a couple of unit tests to it, then send to you. That's a big maybe though =)
# Posted By Sam | 3/12/07 8:44 AM
Hi Sam,

Thanks! Understand the "big maybe", but if you happen to manage it, it'd be much appreciated :->
# Posted By Peter Bell | 3/12/07 8:52 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.