Added Custom Factory Support for LightWire 0.5
Custom factory support added to LightWire. Seems solid as I was able to use the TransferFactory to create transfer which was then ready for injection (I tested using tblog and have just commented out the necessary config in the LightWireTest project as it'll only work if you have transfer and tblog installed).
Let me know if any problems at all! Below is an updated zip file (although unlike Brian I'm still doing this manually. Ant scripts are on the list for later this spring :->).
Also committed to svn: http://svn.riaforge.org/lightwire



addSingleton("transfer.TransferFactory");
addConstructorProperty("TransferFactory", "datasourcePath", "/H2O/config/datasource.xml.cfm");
addConstructorProperty("TransferFactory", "configPath", "/H2O/config/transfer.xml.cfm");
addConstructorProperty("TransferFactory", "definitionPath", "/H2O/config/definitions");
addSingletonFromFactory("TransferFactory", "getTransfer", "transfer");
I keep getting the following error:
Element CONSTRUCTORDEPENDENCYSTRUCT is undefined in a CFML structure referenced as part of an expression
I looked in the files and sure enough it seems that structure isn't defined for an object created from a factory. Am I missing something here? I've got the latest LightWire from SVN, but also tried it using the one that comes with ColdBox and I get the same error.
Received. Let me check this out. Expect response some time today including patch and comments. Of course, if you happen to see a way to patch this, please just dorp in and email me and I'll review and implement!
variables.config[BeanName].ConstructorDependencyStruct = StructNew();
variables.config[BeanName].SetterDependencyStruct = StructNew();
variables.config[BeanName].MixinDependencyStruct = StructNew();
variables.config[BeanName].InitMethod = "";
Basically I added a bunch of properties that are set by addBean(). Just not sure it's really meant to be that way, I haven't used LightWire enough to know if this can cause problems elsewhere.
That should work fine. I'll play with this tonight and create a release. Problem is that I don't actually use the factory support, so it hasn't got beaten up much. Will keep you posted - thanks!
Also, please let me know after that change if you happen to run into any problems or not.
I started having the same problem with Lightwire and Transfer as Thomas (above). The modification to the Lightwire code that Thomas recommends worked though.
Thanks for the heads up. Things got a little busy, but I've got some code debt repayment scheduled for mid-February, so I've put this on the list to review/fix.