Even though Dave didn't actually necessarily say to _favor_ Setter over Constructor injection, I tend to agree with Sean in using setter injection when wiring together true collaborators. One thing to think about I suppose is, how would you construct your objects _without_ ColdSpring? Here is where I would often pass objects into init methods, so a point could definitely be made that I am actually tailoring my objects to work with ColdSpring, which is not completely optimal. It is best to have your cfcs really not dependent on ColdSpring in any way. However, real world circumstances end up dictating that I often work with circular dependencies, I prefer the notation of defining properties, and I also prefer to try to create my components in a way that they don't necessarily rely on a bunch of other cfcs just to be instantiated in the first place. So I guess as Dave is saying, find what is best for your development style and your architecture and remember there are no hard and fast rules here, ColdSpring is simply not that kind of framework! -Chris On Jul 18, 2006, at 11:15 AM, Sean Corfield wrote:
|
- [coldspring-dev] constructor-arg vs property Perry Woodin
- [coldspring-dev] constructor-arg vs property Sean Corfield
- [coldspring-dev] constructor-arg vs property Teddy Payne
- [coldspring-dev] constructor-arg vs property Dave Ross
- [coldspring-dev] constructor-arg vs property Perry Woodin
- [coldspring-dev] constructor-arg vs property Tom Chiverton
- [coldspring-dev] constructor-arg vs property Chris Scott