Making configuration even easier with ColdSpring’s hidden gems

In my last post, we went through a brief introduction of ColdSpring and how you can use it to make configuring your application’s objects much easier. We discussed how objects (beans) are declared in ColdSpring’s XML configuration file and how you can pass any number of values into ColdSpring to be used in configuring those beans using the defaultProperties argument when you create the ColdSpring obect. At the end of the post, we touched on a slight “problem” with using ColdSpring this way.

To be fair, the “problem” isn’t with ColdSpring at all. The problem is with us developers–we’re lazy and we hate redundant typing. In a large application with dozens or more objects, we don’t want to constantly have to type ${dsn} every time we want to inject the DSN property into a bean. Multiply dozens of objects by potentially several properties needed by each object and you can set yourself up for quite a bit of typing, just to get the beans configured (and that doesn’t even take into account that most of us are bad typists and can’t spell DSN the same way a dozen times in a row).

Read More