June 2009 Entries

Principles, Code-Behind, & View Engines

The July issue of MSDN Magazine is available online with my article “Guiding Principles For Your ASP.NET MVC Applications”. Another MVC article in this issue is Justin Etheredge’s “Building Testable ASP.NET MVC Applications”. Justin’s article is a good one as he shows you how to design for testability, and includes specific examples with xUnit.net, moq, and Ninject. Something we both touched on was the topic of code-behind files. Code-Behind and ASP.NET MVC The conversation between two developers (let’s call them Pushy and Principled), goes like this: Pushy: Is it OK to use code-behind files with aspx...

Functional Programming Battles GOTOzilla

Steve Wellens had a recent blog post arguing for the use of a goto in C# (see: Why goto Still Exists in C#). Steve had a series of methods he wants to execute, but he wants to stop if any given method returns false. At the end of the post, Steve decided that the following code with goto was better than setting boolean variables: // DoProcess using goto void DoProcess3() { LOG("DoProcess Started..."); if (Step1() == false) goto EXIT; if (Step2() == false) ...

Progressive .NET Event In Stockholm

Øredev is putting together an exciting lineup of topics and speakers for Progressive .NET Days. The event is August 27-28 in Stockholm Sweden. Progressive software development understands that tomorrow's better ideas for software development are likely here with us today and seeks them out now, building bridges that span paradigms through practice and experience. I’m excited to be a part of the event, and wish I could also sit in on every other session.I’ve also had a dream to ride in a hot air balloon, which I understand is quite popular during the summer months in...

When Do I Use Interfaces?

“Program to an interface, not an implementation” is a well-known mantra from the GoF book. Take this guidance to an extreme, though, and you generate POO instead of OOP. How do know if you crossed the line? I think it’s useful to take a step back and think about the word “interface” in a general sense. There are interfaces everywhere in software.  There are interfaces between layers, between tiers, between applications, between objects, and between callers and their callees. Just about anything and everything in software, no matter how trivial, has an interface. The real question with interfaces...

From LINQ to XPath and Back Again

Let’s say you wanted to select the parts for a Lenovo X60 laptop from the following XML. <Root> <Manufacturer Name="Lenovo="> <Model Name="X60=" > <Parts> <!-- ... --> </Parts> </Model> <Model Name="X200="> <!-- ... --> </Model> </Manufacturer> <Manufacturer Name="...=" /> <Manufacturer Name="...=" /> <Manufacturer Name="...=" /> <Manufacturer Name="...=" /> </Root> If you know LINQ to XML, you might load up an XDocument and...

Catching Up On Lean

I now have a number of lean software development books queued up. It started when I saw this single bullet point in a presentation: Overproduction == Extra Features I’m enjoying the thinking behind lean, and I believe the techniques and vocabulary of lean makes software development more tangible to the folks we work with who don’t write code – and that’s important. Overproduction in software development happens when you produce a feature that customers rarely use. This is one of lean’s seven deadly types of wastes. The perfect technique to manage this waste is to never create a...

Don't Ask Me If It's Possible

Years ago, ex-Googler Doug Edwards wrote a blog post to explain the meaning behind a few favorite words in the software developer’s vocabulary: orthogonal, cruft, canonical, and the big one - non-trivial. Non-trivialIt means impossible. Since no engineer is going to admit something is impossible, they use this word instead. I’ve spent the bulk of my career developing commercial software, and it’s amazing how many sales people, executives, and marketing managers ask if something is possible. Example: Is it possible to reverse the flow of time when we click this button? The requests are more realistic, of...