April 9, 2012

Conditional Builder Design Pattern

Have you ever wanted to use the Builder design pattern to create a really cool fluent interface for building objects but you wanted to add conditions to the building? The good news is that you can do something like so:


Notice how in this contrived example a ninja only gets the "hide in shadows" skill after reaching 6th level? To handle a conditional builder take a look at the following code:

For a complete sample project check it out on my GitHub account!

August 10, 2011

The Decorator Pattern with Ninject


The Decorator Pattern is an excellent way to add functionality to existing objects at run time while honoring the open/closed principle. I decided to put together a sample project demonstrating this pattern in C# along with the DI container Ninject.

August 3, 2011

Git Workflow With Submodules

This quick and raw post describes the typical workflow of using Git with submodules...