ColdSpring and Dependency Injection for the beginner part 3: Setter Injection.

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).

Posted: 27-Nov-2006

View: 6537

Permalink: here

Comments

Here's another great resource: http://aria-media.com/blog/index.cfm/2006/9/22/The...
I think if I read both of these at the same time I might get it one day. Thanks Andy.

#1 Antony
28/Nov/06 3:29 AM

I would like to thank you for the efforts you have made in writing this post. http://www.yourlistings.org/

#2 saraceejay
12/Aug/11 1:53 PM