Monthly Archives: May 2010

Testing assumptions with preconditions

While driving design with unit tests, I often break behaviors out into separate classes, both to increase cohesion, and as a side effect, increase testability.  Occasionally, I run into situations where I have some sort of environmental variable that never … Continue reading 

Posted in Testing | 10 Comments

The religion of dependency injection

A quick way to explain a set of differing opinions is to label it as “a religious argument”.  In a post about using MEF on NerdDinner, Scott Hanselman showed an example on using poor man’s DI versus regular DI.  Now, … Continue reading 

Posted in Dependency Injection, Rant | 21 Comments

Dependency Injection in ASP.NET MVC: Views

Other posts in this series: Controllers Contextual controller injection Filters Action Results And now for a bit more controversial shift.  While most folks doing DI in ASP.NET MVC see the benefit of the ability to provide injection around the controller-side … Continue reading 

Posted in ASP.NET MVC, Dependency Injection | 5 Comments

Caveats of C# 4.0 optional parameters

C# 4.0 includes lots of shiny new hammers for us to bang away at every new and existing development problem we face.  One of the more interesting features is the concept of named and optional parameters.  Consider this rather cryptic … Continue reading 

Posted in C# | 12 Comments

Teaching ASP.NET MVC Boot Camp on May 26th

A lot of what I try to do on this blog, user group presentations, and other community events is to try and share the knowledge and experience that I and my teammates have built up over the years.  I’ve hosted … Continue reading 

Posted in ASP.NET MVC | Leave a comment

Starting and using Git successfully

It took quite a while (around 2 months) for me to finally become comfortable with Git.  Why so long?  One of the benefits of Git is that it’s very powerful.  It’s also one of the drawbacks.  It was a bit … Continue reading 

Posted in git | 18 Comments

AutoMapper 1.1 released

Today I pushed out the 1.1 release of AutoMapper.  From the release notes: Features Adding support for Silverlight 3.0 Auto-implementing INotifyPropertyChanged Conditional member mapping Destination member prefixes, postfixes and naming transformers Enhancements Nullable destination types more obvious Late binding configuration … Continue reading 

Posted in AutoMapper | 1 Comment

Dependency Injection in ASP.NET MVC: Action Results

On a recent, very large project, we started to notice a distinct trend in our controllers.  All of our “POST” actions started to look very similar.  Check form validation, run business rule validation.  If validation succeeds, execute the actual business … Continue reading 

Posted in ASP.NET MVC, Dependency Injection | 6 Comments

Dependency Injection in ASP.NET MVC: Filters

So far, we’ve looked at extending the advantages of dependency injection to our controllers and its various services.  We started with a basic controller factory that merely instantiates controllers to one that takes advantage of the modern container feature of … Continue reading 

Posted in ASP.NET MVC, Dependency Injection | 21 Comments