Onto part 3 of this rough beginners tutorial. By now you should of read part 1 and part 2 and this is the final part of me explaining Dependency Injection. This doesn't mean that come the end of this post you'll now know everything. But you'll know the basics, and be able to walk away and understand a little more of how and where to use ColdSpring.
To go back a little as since my first post there has been for my American readers a national holiday - Deep Fried Turkey day or Thanksgiving as it is better known (sorry I had to mention the deep fried [whole]turkey, I don't know if it because I'm British, but it just seems wrong!). Back to the code.....todays topic is is Setter Injection and to recap from the ColdSpring site;
<property name="propertyName" />
Similar in nature to constructor arg, however in this case ColdSpring will pass some value or object reference into your bean as an argument to a setter method, identified via the name attribute. Thus, your CFC must have a setter method name that matches the property tag's name attribute (for example if your property is named "foo" then your CFC needs a setFoo() method).