A place to keep my thoughts on programming

Monthly Archives: June 2009

Designing a Delegate Injection Container

In my last post I proposed using delegates instead of interfaces to declare dependencies for injection. While delegates are limited to a single function call, this is often sufficient for service dependencies. In addition, this is not a wholesale replacement … Continue reading

June 22, 2009 .net, geek

Ultimate Interface Segregation: Dependency injection by Delegate

I’ve been on a bit of a tear about declaring dependency contracts and injecting only what is required. While examining the use of Interfaces in IoC and their shortcomings, I decided that taken to the extreme, dependencies come down to … Continue reading

June 20, 2009 geek , , ,

C# duck-typing to the rescue for Interface Segregation

Interfaces are the method by which we get multiple inheritance in C#, Java, etc. They are contracts without implementation. We don’t get the messy resolution of which code to use from multiple base classes, because there’s only one inheritance chain … Continue reading

June 18, 2009 geek , , , ,

Interfaces put contracts at the wrong end of the dependency

Over the years I’ve hopped back and forth between static and dynamically typed languages, trying to find the sweet spot. I currently still favor managed, static languages like C# and Java. But I agree that sometimes I have to write … Continue reading

June 16, 2009 geek , , ,

When using won’t Dispose

The using statement/block in C# (not the one used to pull in namespaces) is meant to aid in the IDisposable pattern, i.e. cleaning up resources that won’t be handled by garbage collection and to do so in a deterministic fashion. … Continue reading

June 13, 2009 geek , , ,

Searching a Tree of Objects with Linq, Revisited

A while back, I wrote about searching through a tree using linq to objects. That post was mostly snippets of code about delegates, lambda’s, yield and how it applies to linq — more a technical exploration than an example. So … Continue reading

June 11, 2009 .net , , , , , ,

Log4Net filtering by logger

Since i keep overwriting my App.Config with revision control configs and promptly forgetting how to set up filters, I figured i might was well write a brief article on filters here, so i have a place to look it up … Continue reading

June 7, 2009 geek , ,