Validate User Input, Not Developer Input

I have a very simple rule, I like to follow that helps to simplify my code. “Don’t validate developer input” This rule simply means that we should not try and validate input that came from a source that is not a user or external system. Another way to put it would be, don’t validate parameters you pass around in your ...

Read More »

WCF Rest Services for Windows Phone

So great, to create WCF Rest services for Windows Phone, you have to follow just 5 steps. This post will have more code than words, making it neat and to-the-point Step 1: Create a WCF Service Define the interface IMyService in ‘Services’ folder of YourWebsite namespace YourWebsite.Services { [ServiceContract(Namespace = "http://YourWebsite.com/services", Name = "MyService")] public interface IMyService { [OperationContract(Name="DoWork")] [WebGet(UriTemplate ...

Read More »

Migrating from Mercurial to Git

I have used quite a lot of source control systems: started with Visual Source Safe, then used SVN, various versions of TFS, SourceGear for a short while, StarTeam, Mercurial and Git … and in my opinion Git is THE most awesome source control system (even if you were to discount its distributed nature so you can compare it with non-distributed ...

Read More »

Why Did Agile Originate In Software?

I was reading Lior Friedman’s post about the agile research. He raises an interesting question: Why are agile studies coming from the exact science fields? After all, we don’t see groups of accountants doing a stand-up meeting every morning. The easy answer of course, that’s where they practiced mostly. We tend to look under the flashlight. But the more important ...

Read More »

The Five Orders of Ignorance – Phillip G. Armour

While trawling the comments of Dan North’s ‘Deliberate Discovery‘ post I came across an interesting article written by Phillip G. Armour titled ‘The Five Orders of Ignorance‘. The main thing I took from the article is that the author uses the metaphor of software as a ‘knowledge acquisition activity’ for which he then defines five orders of ignorance that we ...

Read More »

Roll Your Own REST-ful WCF Router

Recently I’ve been tasked with building a WCF routing service and faced the choice of whether to go with the built-in router that ships with WCF 4.0, or to build one from scratch. The built-in router is great for a lot of different scenarios – it provides content-based routing, multicasting, protocol bridging, and failover-based routing. However, as the MSDN documentation ...

Read More »

C# text file deduping based on trimmed lines

A while ago, I needed to analyze a bunch of files based on the unique trimmed lines in them. I based my code on the C# Tee filter and the StackOverflow example of C# deduping based on split. It is a bit more extensive than strictly needed, as it has a few more commandline arguments that come in handy when ...

Read More »

Use Scrum even if you don’t want to be Agile

An “Agile” project is one that actively seeks to incorporate changes as the project progresses, rather than assuming that the plans from the beginning of the project will work for the whole project duration. Not all organizations want to adopt “agile” as their project metaphor. And some organizations that do adopt methods such as Scrum do it without becoming as ...

Read More »

Limit your abstractions: Refactoring toward reduced abstractions

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

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 »