Fun with Generics: BindingList and ReadOnlyCollection

Mitch Denny’s post about List events and Bill McCarthy’s subsequent answer pointing him to BindingList had me looking at some Generics Design Guidelines and there were two generic collection types that I really glad I found out about. Mitch’s question (“why doesn’t List<T> fire events”) was similar to the one I was asking myself the other day. I was…


Presentation: Refactoring

Last week I gave a presentation at the Melbourne Microsoft Developer Group (MDNUG) on Refactoring with code examples in C# (.Net) and using Visual Studio 2005 for some live demonstrations. The slide deck for my Refactoring presentation is available here.


OJB.Net and Generics

I posted a little while ago about trying to use reflection with generic types. I have been trying to use a generic list type within OJB.Net (an object relational mapper for .Net). I finished investigating this and thought I’d post a write-up about it here in case anyone else is using or wants to use OJB.Net and…


Generics in OJB.Net (a.k.a. Generics Type Madness)

At iP3 we are using OJB.Net for object relational persistence. It is really easy to use, but it was using an ArrayList by default and we wanted to use the new Whidbey Generics List<> type. When OJB.Net creates objects out of the relational data, it uses reflection to generate the IList collection object which is ArrayList by…

5

Safer C# Constructor-based Dependency Injection with readonly

Most people would have used the const keyword while doing C# development, but I had never heard of the readonly keyword before. Well, this weekend I had a friend point out this keyword and the first usage that came to mind was constructor-based dependency injection. Here is the clarification of the differences between readonly and const from…

2