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

ColdSpring: An answer to a problem you may not know you have

Over the last two years or so I’ve been working hard to really “get” object-oriented programming as it applies to ColdFusion development. Like a lot of ColdFusion developers that have been around a while, when I started trying to create applications using CFCs, I essentially had CFCs that were collections of UDFs. Before long, after talking with other developers that understood OO principles, I started making my CFCs more “object’y” as I learned more about those principles.

Along the way I naturally heard about various frameworks related to ColdFusion (Fusebox, Model-Glue, Mach-II, ColdSpring etc etc) but never gave them more than a passing glance as I was trying to cram a bunch of new concepts into my brain as it was and I just didn’t have the mental bandwidth to take on frameworks at the same time (however that has since changed and I’ve had a chance to work with Mach-II and Model-Glue). Eventually I got to the point where my applications used numerous objects and some of those objects required the services of other objects to do their jobs. That’s the point that I really began struggling with the effort involved in writing a good OO application. It took lots of lines of code to create an object, configure it simply to pass it into another object. Sound familiar? Maybe you’re at that point with your ColdFusion OO trek. If so, read on and I’ll introduce you to ColdSpring, a free dependency-injection framework (whoa there, stay with me, don’t let the buzzwords turn you off) that will make your life much easier.

Read More