discovered: the spring framework
i’ve been reading through some articles about java programming on javalobby.org, where i came across and article talking about the spring framework. it sounded interesting so i read this article by martin fowler which explains how the dependency injection pattern (aka inversion of control) works. basically, it means that a class is no more responsible for fetching objects/resoures it depends on by itself but these are injected into an object by the framework.
having become really excited about it i then read this article about spring, which gives a (long) introduction on how spring works and how to use it - wow, this is revolutionary (at least for me).
all spring basically does is decouple the business logic of an (enterprise) application from all kinds of frameworks and implementation platforms by making extensive use of the dependency injection pattern. but the consequences are enourmous. you can now change your storage layer without changing any code - instead you simply edit a bunch of configuration files.
the second impact is that the business layer becomes much lighter since all these service/component lookup/creation calls are gone.
finally, the code becomes much easier to test. as dependencies are now injected into the classes instead of being looked up by the code itself a test case can simply inject a dummy service - ejb components can now be tested outside a container (if you want to use them at all, now that you have spring)
