I like the way he first shows the need for the refactor and the reasons why. I especially like the use of the anonymous delegates. I’ve been a big fan of anonymous delegates in my querying of generic collections with the List in C#. I typically use an inline anonymous delegate – his example shows both.
Notice the use of the injection from the IoC container (I’m fairly certain he is using Windsor).
The first time I really have been able to work with the fluent interfaces is with the ICriteria in NHibernate. The ability to chain together the queries offers a powerful and and easy to comprehend syntax.
The example given in the above link:
IList cats = sess.CreateCriteria(typeof(Cat)) .Add( Expression.Like("Name", "Fritz%") ) .Add( Expression.Or( Expression.Eq( "Age", 0 ), Expression.IsNull("Age") ) ) .List();
Joey’s article gives a good explanation and example of how to do this in your own solutions.
Go check out the article, it’s good to see these examples!