Home » 2012 » May

Monthly Archives: May 2012

Limit your abstractions: Refactoring toward reduced abstractions

software-development-2-logo

So in my previous post I spoke about this code and the complexity behind it: public class CargoAdminController : BaseController { [AcceptVerbs(HttpVerbs.Post)] public ActionResult Register( [ModelBinder(typeof (RegistrationCommandBinder))] RegistrationCommand registrationCommand) { DateTime arrivalDeadlineDateTime = DateTime.ParseExact(registrationCommand.ArrivalDeadline, RegisterDateFormat,CultureInfo.InvariantCulture); string trackingId = BookingServiceFacade.BookNewCargo(registrationCommand.OriginUnlocode, registrationCommand.DestinationUnlocode, arrivalDeadlineDateTime); return RedirectToAction(ShowActionName, new RouteValueDictionary(new {trackingId})); } } In this post, I intend to show how we can refactor things. ...

Read More »

Behavior Driven, Test Driven, Domain Driven Design

software-development-2-logo

Ah, the joys of xDDs, you can never use too many, right? One of the many benefits of using event sourcing with CQRS is how well it facilitates using BDD style testing to drive our domain model design. Behavior driven development encourages writing tests which expose the use cases or scenarios required by the users and stakeholders. This is closely ...

Read More »

Inversion of control containers – Best practices

dot-net-logo

Disclaimer: I’ve used IoC containers for a couple of years now and also made a couple of my own (just to learn, nothing released). I’ve also consumed loads of documentation in the form of blogs and stackoverflow questions. And I thought that I should share what I’ve learned. In other words: These are my very own subjective best practices. An ...

Read More »

Types of Duplication in Code

csharp-logo

One of the biggest reasons to refactor code is to eliminate duplication. It is pretty easy to introduce duplication in our code either unintentionally or because we don’t know how to prevent or get rid of it.   The three types of duplication I’ve found that there are three basic types of duplication that we can eliminate from our code ...

Read More »

When Will It Be Done?

agile-logo

Everyone likes to know the answer. In fact, this question can be interpreted in many ways, and answered that way too. For example, if we’re using agile techniques, we assume things will go wrong. So what we’re asking really is when is the scope going to be completed. And that’s not the way agile works, does it? What we do ...

Read More »

CInject – Code Inject

cinject-logo

CInject (or CodeInject) allows code injection into any managed assembly without disassembling and recompiling it. It eases the inevitable task of injecting any code in single or multiple methods in one or many assemblies to intercept code for almost any purpose. When using CInject, you do not require any knowledge of the target application. You can create your own injectors ...

Read More »

Why you need to make your tests fail

dot-net-logo

Test Driven Development (TDD) have many benefits. For start it’s a design methodology that help avoiding “Analysis paralysis” and make sure that you only have the needed code to solve a problem. Yesterday I found another benefit of writing the tests before the code – you get to see them fail! A while back I wrote about another shortcoming of ...

Read More »

Developer productivity tools and Visual Studio extensions

visual-studio-logo

A few days ago a question was asked on Readify’s internal forum about useful VS extensions. A few extensions were mentioned that I had not used before and I am glad to have installed them now. So I thought I’d share my current toolbox with you. This is not meant to be anywhere as exhaustive as Hanselman’s Ultimate Developer and ...

Read More »

Building an API: Test Harness UI

software-development-2-logo

On the project I’ve been working on we’re building an API to be used by other applications in the organisation but when we started none of those applications were ready to integrate with us and therefore drive the API design. Initially we tried driving the API through integration style tests but we realised that taking this approach made it quite ...

Read More »

Creating robust tests with Isolator V7

csharp-logo

The problem with unit tests is that they keep on breaking…  Obviously that’s not entirely correct, nevertheless I had the pleasure of hearing the sentence above numerous times. It’s true – unit tests do tend to fail and we prefer that they fail only when a regression occurs – when something that used to work stopped working, because that’s the ...

Read More »