Spring Revisited
Recently I retrofitted some code I was working on to utilize Spring . It's been some time since I'd used it and I'd forgotten how much I enjoy coding in this framework. It really helps me write better, cleaner code. As developers, we always strive to create plug-and-play architectures - you know, code to an interface, achieve easily swappable implementations, etc. That in itself really isn't that hard to do, but Spring really shines in enforcing this idea. My original code (for Jena) needed to grab some Resource references from the model and looked something like this... {method declaration} OntologyModel model = {get model reference} URI resourceUri = new URI("http://www.myCompany.com/MC#myResource1"); Reoruce myResource = model.getResource(resourceUri); {additional business logic} The equivalent Spring configuration replacement for this code looks like this... <bean id="myResource" class="com.myCompany.Resource" factory-bean="...