For all those who made it out the the Lansing DODN, Thank you for attending my session on Dependency Injection with Spring.NET. I hope I was able to set some folks on the path to IoC enlightenment, or at least break any barriers in your way to getting started. I also got to attend some other great sessions by Len Smith, Jay Wren, and Michael Eaton on NHibernate, Inversion of Control, and Active Record, respectively.
There were some good questions asked during the discussion so I've posted the question and answerers below. Please forgive me if they are not verbatim.
Q - Do you have to configure every member of an object in the container?
A - No. Spring.NET will use a mechanism called Autowiring to infer the object instantiation and configuration. Autowire is set to 'No' by default and you are encouraged not to change this for large applications, since specifying your collaborators explicitly gives you a feeling for what you're actually doing (always a bonus) and is a great way of somewhat documenting the structure of your system. Setting Autowire to 'byType' will resolve collaborators by type instead of by name. See 5.3.5 Autowiring collaborators
A - No. Spring.NET will use a mechanism called Autowiring to infer the object instantiation and configuration. Autowire is set to 'No' by default and you are encouraged not to change this for large applications, since specifying your collaborators explicitly gives you a feeling for what you're actually doing (always a bonus) and is a great way of somewhat documenting the structure of your system. Setting Autowire to 'byType' will resolve collaborators by type instead of by name.
See 5.3.5 Autowiring collaborators
Q - Does Spring.NET configure objects as singletons by default?
A - Yes. But turning this off is as easy as adding singleton="false" to the object definition in the configuration file. See 5.4 Object Scopes
A - Yes. But turning this off is as easy as adding singleton="false" to the object definition in the configuration file.
See 5.4 Object Scopes
Q - So which is better, Castle Windsor or Spring.NET?
A - It depends what you're doing. You might find that you use Windsor for one thing and Spring.NET for a another. While both frameworks have some overlaps in functionality, there are also some stark differences that give each one it's place in the world. Why not try both? They're free to download, and if you follow good OO practices, then you shouldn't be tightly coupled to either framework.
I've also posted the slides, demo, and a video of the presentation for those who are interested.
1. Slides
2. Demo
3. Video
Lansing Day of Dot Net from Ryan Montgomery on Vimeo.
Thank you Matt for taking the video!
In a mix of excitement and nausea, I have been chosen to speak at the Lansing Day of Dot Net 2008! My session, 'An Introduction to Dependency Injection using Spring.NET' was selected and I will be speaking on the subject there June 21st, 2008. It all started when I found the www.dayofdotnet.org site while browsing the Internet and happened to see they were looking for speakers. I figured "hey that would be cool" and I submitted my application.
I am very excited to be speaking, but I also feel the nausea that comes with speaking in front of large crowds. I'm a decent public speaker, but this will be the first time I'll be speaking to a room of my peers and mentors talking about technology - hence the nausea.
See you there!
Home
© Rapidparts, Inc 2008 | 2950 Walkent Ct. NW, Grand Rapids, MI 49544 | Phone 616.647.2500 | info@rpionline.com