Persisting model state when using PRG

I’ve been working on an ASP.NET MVC application in which we frequently apply the Post/Redirect/Get pattern. One of the direct consequences of applying this pattern is that you often want to persist the model state across redirects, so that you don’t lose validation errors, or the values of input fields. To persist the model state across redirects, we can put TempData to work. The sole purpose of TempData is exactly this; persisting state until the next request. ...

June 17, 2012 · 2 min · Jef Claes

Making my first NancyFx test pass

Like I already said last week, I have been dabbling a bit with NancyFx lately. This week I took a serious look at testing Nancy modules and Razor views. Due to Nancy’s defaults and conventions, it takes a little while to set up Nancy in a test context. Then again, Nancy’s granularity makes it simple enough to set up a solid test infrastructure by replacing some of its building blocks. Like always, I had to go through several iterations to get it right. ...

June 11, 2012 · 4 min · Jef Claes

Book review: The Art of Agile Development

While I have - obviously - read the Agile Manifesto before, and regularly click through to articles on agile, I had never read an extensive work on it. Browsing for a good book, I was advised by a peer to get The Art of Agile Development. I wholeheartedly believe in the Agile Manifesto, but somewhere along the way Agile - with a capital A - got somewhat of a bad rep. The authors of this book, James Shore and Shane Warden, already predicted this five years ago. Throughout the book, I never had the feeling they were connected to the Agile mob, but just genuinely care about working software. ...

June 10, 2012 · 2 min · Jef Claes

The 'everyone should learn to code' dilemma

Back when I was working on software for fire departments, we started thinking about reworking a critical piece of our solution: deployment plans. In a fire department domain, deployment plans help to make a suggestion to the dispatcher about which units should be dispatched to a location when an incident is called in. The suggested composition of units depends on a wide range of variables: availability, response time, ranks, type of incident, required tools, … , even politics. Originally, people high enough in rank could compose these plans using a decision tree-like UI. However, as it turned out, this UI was insufficient; not all variables and conditions were available. Since this was no custom built tool, we had to work around it by composing incomprehensible decision trees or by tricking the underlying services. When talking about how we could do better, we hit a wall pretty soon. We thought about building our own - but more extensive - UI, and damn, even designing a DSL crossed our minds. ...

June 3, 2012 · 3 min · Jef Claes

The open plan fallacy testimonials

I wrote an article titled ‘The open plan fallacy’ just two weeks ago. Earlier this week a similar article was published by the New York Times. The content of that article wasn’t particularly extraordinary, but the comments were. I waded through all of them on my daily commute, and it’s really hard to find one in favor of open plan offices - people seem to be enraged. I handpicked some of the most interesting ones. ...

May 27, 2012 · 4 min · Jef Claes

Painless database logging with mongoDB

While browsing the source code of the ELMAH mongoDB provider, I learned about a special type of collections: capped collections. From the mongoDB documentation: Capped collections are fixed sized collections that have a very high performance auto-FIFO age-out feature (age out is based on insertion order). In addition, capped collections automatically, with high performance, maintain insertion order for the documents in the collection; this is very powerful for certain use cases such as logging. ...

May 20, 2012 · 2 min · Jef Claes

The open plan fallacy

I haven’t worked in a whole lot of places, somewhere around four, but every single one of them used an open plan to structure their workplace. From what I hear from others, it’s the standard. There are a few things to say about the advantages of an open office layout. They should stimulate communication, create more opportunities for observing and learning from others and be more cost-effective. I’m afraid it’s the latter which is the biggest driver though. ...

May 13, 2012 · 2 min · Jef Claes

Why I will always love RSS

There has been a lot of noise in the tech community earlier this year about how RSS is supposedly having one foot in the grave. If that would be even remotely true, I hope it dies with its boots on. The herald would be browsers and social networking sites killing or hiding support for RSS. While that may be true, their motives shouldn’t rig our opinions. RSS has never worked out for the regular consumer, not directly anyways. So I get why browsers are dropping support for it, I am not even disappointed. Most popular social networks have enough traction by now so that they can safely start fencing their gardens with the purpose of bringing more money in. Also reasonable. ...

May 6, 2012 · 2 min · Jef Claes

My InfoQ article on HTML5 offline web applications

After writing a few things on HTML5 offline web applications earlier this year, I got contacted by InfoQ to write an in-detail article on the subject for them. I hesitated at first, because I was afraid that it would feel too much like work, taking the fun out of my writing. Turns out it wasn’t like that at all. The guys at infoQ were really relaxed to work with, asking interesting questions and giving useful feedback, without forcing me into a certain direction. A pleasant experience. ...

May 2, 2012 · 1 min · Jef Claes

Some Servicelocator pattern stinks

I have been working on a somewhat legacy codebase which makes use of the Servicelocator pattern. Although I always thought of Dependecy Injection to be the superior pattern, I was pleased to find some Inversion of Control implementation in there. Working with the codebase, I discovered first hand how easily, when used without caution and discipline, the Servicelocator pattern can introduce code rot. I will walk you through some of the issues I have with the Servicelocator pattern, mostly looking at it from a test perspective. It’s interesting how you can often quickly discover friction in a codebase by just looking at, or writing, tests. ...

April 17, 2012 · 4 min · Jef Claes