May 21, 2007
Brian Kotek has an
excellent post about using ColdSpring to its full potential, in response to a series of articles on Tom Chiverton's blog about building services with ColdSpring and Reactor.
Brian shows how to use the factory-bean and factory-method descriptors in your ColdSpring XML file to handle automatic injection of beans obtained from factory objects that are also managed by ColdSpring. It's a powerful technique that helps completely remove a number of dependencies from your application code.
I use the same technique with Transfer and ColdSpring:
<bean id="dataSource" factory-bean="transferFactory" factory-method="getDatasource" />
<bean id="transfer" factory-bean="transferFactory" factory-method="getTransfer" />
This allows me to inject the data source object and the main Transfer API object directly into my service layer objects so they don't have to know about the Transfer factory at all.
Comments
Sean,
is there some tutorials or something like it on using ColdSpring or LightWire with MG? I like the concept but I'm new to it and it seems I can't find simple docs to get me started.
Posted By Boyan / Posted At
5/22/07 9:55 AM
@Boyan, there isn't much tutorial documentation out there really. Ray Camden ran a series of posts about Model-Glue on his blog that might help you. Joe's "Blog in 9 minutes" video might help. Google for those. Otherwise, get on the Model-Glue mailing list (on Google Groups) and ask questions.
Posted By Sean Corfield / Posted At
5/22/07 11:17 AM
Post Your Comments
Hosting provided by