The Custom Configuration Section Code Smell

I was recently involved in a project that involved some design-time configuration.  That design-time configuration was based on custom config sections. I didn’t really pay too much attention to it at the time because I don’t write my own custom config sections.  As I worked on the project and do what I usually do by refactoring and evolving the system to use various patterns and principles, I came to realize why I don’t use my own custom config sections. That realization came as I began refactoring code for dependency inversion.  As I progressed getting the majority object creation code to … Continue reading The Custom Configuration Section Code Smell

Unbind a Visual Studio 2010 Solution from Source Code Control

I was working with a solution that I got from someone else the other day.  When I loaded it up, Visual Studio 2010 informed me that it could not connect to a TFS server at some URL and will open the solution in offline mode (or something to that effect).  Of course, I have no access to this TFS server, so, I’m going to get this message every time I open this solution.  That’s going to get annoying pretty fast. So, I had a quick search on the Internet about removing source code control from a Visual Studio 2010.  I … Continue reading Unbind a Visual Studio 2010 Solution from Source Code Control

Fluent Builders Part 2

In this part I’m going to go into the principles behind a fluent builder. Fluent builders don’t simply provide a method for each argument a constructor (or other method) may take, they provide consistency when providing related arguments. In my fluent builder example I had a WithCredentials method on the builder that take two related arguments: a username and a password.  I could have just as easily have a WithPassword and WithUserName method and used it like this: Subscription subscription = new RabbitMQSubscriptionBuilder() .WithUserName("pQowiht12glsh%d") .ToHost("localhost", 8181) .WithPassword("i21uWghe&gjs") .SubscribeToQueue("messages");   We achieve the same result; but now we can have username and … Continue reading Fluent Builders Part 2

Fluent Builders, Part 1

I’ve seen some conversations about fluent builders as of late, and I’d thought I’d post some information about fluent builders, the principles behind them, the problems they address, and how to implement them. Fluent Builder is a combination of the builder pattern and a fluent API. The builder pattern is similar to the factory pattern in that it’s intended to abstract the creation of other objects.  This is often meant to abstract the fact that many objects need to be created (ala the composite pattern).  It’s often intended to hide the fact that the creation of one object is dependant … Continue reading Fluent Builders, Part 1