CFUnited: Mark Drew — ColdSpring: Better Living Through Configuration

I'll be updating this post with notes from the presentation as it goes on...

Welcome, all, to Spaghetti Coder's Anonymous. ColdSpring is an IoC framework. (Inversion of Control) aka Dependency Injection Framework. It has a component factory (bean factory) built in.

Without ColdSpring, you need to wire together your dependencies. This causes coupling, which is in theory, a bad practice. When one of your dependencies needs to change, you have to change it in every location it's used. This is less maintainable code. With ColdSpring, you have "separation of concerns." Components don't have to do things that are not related to their function. They don't have to do anything except their own function.

Another benefit is that it's easier to create testing stubs, you can see all of your components and how they relate in once place (xml config).

  • Bean = Component
  • Bean Factory = ColdSpring - holder of the beans
  • Singleton = there is only one
  • Lazy load = only loaded when needed.

Properties and constructor arguments can be more than just simple value and ref bean's. Can also be a list or array, or a structure (map).

A singleton is a bean that only gets created once, and the same instance is passed to anything that requests it; whereas a non-singleton is recreated any time it is requested. Ssingletons are persisted inside the bean factory; so wherever you store your bean factory, you're also storing singletons. (Application scope is generally the default)

Mark also showed how AOP can be used to do some pretty neat stuff with Accessors and Interceptors.

And said something about actually being a woman.

in CFUnited Posted 2008-06-18 01:24