An MVC Gotcha and the PRG Pattern

If you’ve recently moved across to ASP.NET MVC development following years of wrangling with the leaky abstraction that was WebForms, you may have encountered some seemingly curious behaviour when posting back to the same URL. Suppose we have the following simple, contrived and utterly imagination-free model: Here’s a view: And here’s the controller: Note that we have two separate Index actions – one for HTTP GET which instantiates and displays a new FooModel instance, and one for HTTP POST which modifies one of the properties on the posted FooModel instance before re-rendering the view. ...

9 April 2010

On The Market Again

This blog post comes to you live from a Starbucks in the north of England. Yesterday I wrapped up another eight months’ stint contracting at my old haunt Marshalls Plc. It’s been a genuinely interesting gig, working on two distinct greenfield projects using bang up to date technologies including .NET 4.0 and MVC2. But it hasn’t just been a benefit for my CV, I think Marshalls might have got a little something out of the arrangement too, as Marshalls’ Development Manager Sion Harrison commented yesterday: ...

1 April 2010

MoreLINQ – IEnumerable Extension From Jon Skeet

I’ve just become aware of this MoreLINQ project containing some neat IEnumerable extensions authored by the inimitable Jon Skeet. I particularly like the look of DistinctBy – that’s gotta be a lot easier than passing custom instances of IEqualityComparer into Distinct(). Fun fact – I used to work with someone who went to school with Jon Skeet! True Story!

30 March 2010

On the Inherent Negativity of Computer Programmers

A couple of weeks ago, early one morning, my friend and fellow coder Scott asked a curious question: “Do you think that programming computers for a living gives you a negative outlook on life?” Now, Scott is unfortunately responsible for administering occasional TLC to a codebase that I cut as long ago as 2004, so I assumed he was referring to this and was about to raise some complaints about my hand-rolled query object criteria framework or other coding horror. I steeled myself to defend my work as he continued to explain: ...

1 February 2010

Deduplication Fail

Oh, the irony!

2 December 2009

A Circuit Breaker Which Trips On Frequency Of Failures

@Jez tweeted last night: Funny, but not true. I am enamoured with the Castle Windsor project because its power makes it fairly simple for me to develop loosely-coupled systems which are easily maintained and tested. The wide range of Facilities and Contrib projects also integrate nicely with the other parts of my current development stack (NHibernate, WCF, WF, log4net). ...

28 October 2009

Castle Windsor Array Resolution Gotcha

The shiny new system which I’ve recently been developing makes heavy use of the Chain of Responsibility pattern, and as such a number of service classes take an array of objects in the constructor: I’m using Castle Windsor for dependency management, so I’ve been fluently registering all instances of ILeadAllocator: Easy, right? And yet at runtime Windsor surprised me by throwing this exception in my face: Castle.MicroKernel.Handlers.HandlerException: Can’t create component ‘Marshalls.Leads.ApplicationService.LeadAllocationService’ as it has dependencies to be satisfied. ...

26 October 2009

On Primality In Packsizes

Benny George, our precocious two-year-old, is quite the fan of Mister Maker, and enjoys spending time doing arty crafty stuff with his mum. Now, the great thing about the BBC is that they tend to suggest projects which can be created using bits and bobs that you’re likely to have around the home – old cereal boxes and the like. But occasionally some specialist resources have to be procured in the name of Ben’s art, and so it was that Joce today spent £1.99 on a pack of the “googly eyes” so beloved of Maker. ...

23 October 2009

Castle Windsor Lifestyle Gotcha

I always knew my lifestyle choices would come back to bite me some day… I’ve been making heavy use of the Castle Windsor container to handle dependency and configuration management in the shiny new system that I’m currently developing. For the most part it’s been an absolute blast, allowing me to easily create a loosely-coupled system architecture and focus my efforts on what the system should be achieving for the client, rather than worrying about how it all hangs together. ...

19 October 2009

SQL 2008 – Missing Indexes Hints

Improvements to the Execution Plan UI in SQL Server Management Studio 2008 sure do make it a doddle to improve query execution time. A client just reported that a particular stored procedure kept timing out. Viewing the Estimated Execution Plan for this query displayed a nice green message advising of a potentially missing index which could improve performance by >95%: ...

11 June 2009

Agile Yorkshire @ The Pub – Gojko Adzic, 10th June 2009

If you’re in the Leeds area next Wednesday, why not come along to this Agile Yorkshire session? 10th June – Gojko Adzic: Slim, The Future Of FitNesse Details This talk will introduce Slim, the most important upgrade to FitNesse in years. Slim is the new test runner which promises to bring platform interoperability, easier integration, a much simpler programming model and lots of small helpers that will allow us to write and maintain executable specifications and acceptance tests easier. This is a session for .NET and Java developers. Some prior exposure to FitNesse and FIT would be beneficial, but not required. ...

5 June 2009

Ian Nelson, MCPD

Well, for the record, I passed MS exam 70-553 yesterday on my second attempt, which makes me a Microsoft Certified Professional Developer – Enterprise Application Developer: And I also acquired a few new MCTS certifications as a happy by-product: My full transcript, including “legacy” certifications, is here. ...

27 May 2009

New Office Photos

I promised you some photos of my new office a while back, didn’t I? OK, here you go… The Desk The Computer One of These Books Is Not Like The Others Bits n Bobs In Gnasher We Trust ...

22 May 2009

NHProf – NHibernate Profiler

The inimitable Ayende Rahien is close to releasing version 1.0 of his NHibernate Profiler tool, and it really is shaping up to be a rather lovely little addition to my developer toolbox. In much the same way that we can use SQL Server Profiler to monitor database activity, and ANTS Profiler to monitor the performance and memory usage of .NET applications, NHProf profiles the activity of the data access layer (NHibernate), and even goes as far as providing helpful hints for potential improvements. ...

19 May 2009

TFS: Using Alternative Diff/Merge Tools

There are many things I love about Team Foundation Server, but the supplied diff/merge tool is not one of them. It is – how can I put this? – somewhat basic. Indeed, I’ve heard tell of people going out of their way to avoid merges purely because they find the process so clunky. Here’s the good news – you can easily configure TFS to use a different, third-party, diff/merge tool, perhaps the one you’ve grown to know and love over many years of happy software development using other SCM products. Maybe you like WinMerge, or love TortoiseMerge. Perhaps you’re like my friend John and swear by SourceGear DiffMerge. Or maybe, like me, you’re a Beyond Compare fanboy. No problem, they can all be used by TFS. Here’s how: ...

19 May 2009