tag:blogger.com,1999:blog-5424132702988443424.post2350695977031934260..comments2023-10-26T07:43:05.437-05:00Comments on Bears. Beets. Battlestar Galactica.: Annotation-based Dependency Injection using ColdSpringTony Nelsonhttp://www.blogger.com/profile/17222036859676784775noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5424132702988443424.post-74755025118371523742009-09-08T09:25:36.220-05:002009-09-08T09:25:36.220-05:00I don't mind autowiring dependencies using cfp...I don't mind autowiring dependencies using cfproperty tags (I think that's how ColdBox does it too), I just found out about the "beans" attribute from Model-Glue and it seemed to make sense to me.<br /><br />Probably the biggest downside to using a factory post processor is that ColdSpring needs to construct all the beans that have dependencies on initialization, which means no more lazy-loading. However, if ColdSpring (fully) supported bean post processors, then lazy-loading would work fine. Hopefully it'll be fully supported in the next release of ColdSpring, which I heard is in the works. In the meantime, I extended ColdSpring to add my own bean post processor support.Tony Nelsonhttps://www.blogger.com/profile/17222036859676784775noreply@blogger.comtag:blogger.com,1999:blog-5424132702988443424.post-48132362719573655452009-09-08T08:54:47.324-05:002009-09-08T08:54:47.324-05:00Interesting. What I'm doing in CF9 is using a ...Interesting. What I'm doing in CF9 is using a cfproperty tag to create an implicit setter for each bean that I need. I then use Brian Kotek's BeanInjector to automatically inject any dependencies, which can be done with a single line of code.<br /><br />I think it accomplishes the same thing that you're doing, but it does require one property per bean, as opposed to your list of beans, which is more succinct.Bob Silverberghttp://www.silverwareconsulting.comnoreply@blogger.comtag:blogger.com,1999:blog-5424132702988443424.post-3194912061679680972009-09-02T08:49:35.958-05:002009-09-02T08:49:35.958-05:00While you could name the injection method anything...While you could name the injection method anything, I chose "__setVariable" because I didn't want to override any methods that already exist inside my CFCs and I took the assumption that people wouldn't already have a method named __setVariable.Tony Nelsonhttps://www.blogger.com/profile/17222036859676784775noreply@blogger.comtag:blogger.com,1999:blog-5424132702988443424.post-20514489056021161812009-09-02T04:46:04.131-05:002009-09-02T04:46:04.131-05:00I have always had a tough time reading XML for som...I have always had a tough time reading XML for some reason. It's the custom tags that throw me off. This is pretty cool. Did you mean to have the space for the function name " setVariable"?Ryan Vikanderhttps://www.blogger.com/profile/08402339086175450431noreply@blogger.com