Thursday, September 3, 2009

Tech Days - Calgary

I've just confirmed that I'll be giving a talk in Calgary on November 17th, 2009 at Tech Days Canada. Incidentally, that's also my sister's birthday - this one's for you Heather ;)

The talk will be an introduction to Test Driven Development and how it can reduce the number of defects in your software. More to come on this, but this two day event should be pretty good. I highly recommend the 2nd day of the "Developing for Microsoft based-platforms" as it has two sessions on ASP.NET MVC.

Hope to see you there!

Saturday, August 29, 2009

Agile 2009 - Summary

Overall I think this conference was well worth going attending. On average most of the attendees were new to agile. It is refreshing to see their excitement during the sessions. In particular I found Alistair Cockburn's session on story slicing very helpful. Take home message - next time you work on a story try to demo it to yourself every 15 minutes to showcase a visible difference (even if only a small one).

Sumeet Moghe co-presented the Distributed Agile Game. I always love to present with Sumeet as he is one of the best facilitators I know. I think the participants all got the lessons of how painful the distributed situation can be, but also how to remedy common communication problems.

Well I'm hanging up my conference hat for this week, but I'm back at it in late September or early October for Microsoft's TechDays. I'll be talking about my current technical passion ASP.NET MVC.

Friday, June 12, 2009

Twitter: The Quest for the Ultimate One-Liner

This month Time Magazine is publishing an article on how Twitter is revolutionizing society. Sigh.

For those of you who don't know what Twitter is, it's like Facebook's status messages but it's 24x7. You subscribe to your friends/colleagues/celebrity status updates to know what everyone is doing all the time. They call this activity "Tweeting", which to me sounds more like human flatulence than anything else. It looks something like this:

"@Starbucks writing this status message"
"Enjoying this nice sunny day"
"@conference learning about Agile software development"

Of course the above are not ultimate one-liners by any stretch of the imagination :)

It strikes me that these social networking sites are nothing more than the shameful quest to come up with the ultimate one-liner. It reminds me of the character Lord Henry Wotton in Oscar Wilde's The Picture of Dorian Gray, charming and witty but with no true substance.

Why not write a real short story? Or a poem? Instead of broadcasting all the details of your life to a bunch of strangers, why not commit your most profound thoughts to your close friends and family?

My real problem with Twitter or Facebook for that matter is that we really don't see a complete story. We see only the part that we wish to expose to the public, and this to me is ridden with shallowness.

Time Magazine might call it a revolution, but I think it's meaningless entertainment. The ultimate high school popularity contest. The winner will have the most followers with the most interesting one liners. I might have to paint some bloggers with the same brush. All fluff, no substance.

I'll admit that I've been drawn into Facebook from time to time, but I think I would be just as happy (perhaps happier) if I had never created an account. A friend of mine once said to his daughter who had over 700 friends on Facebook "if you truly have 700 friends, you are the shallowest of persons I know." Humans really only have room for 10-20 real relationships, so why fool yourself into thinking otherwise?

End Rant.

Tuesday, June 9, 2009

Pragmatic Architecture

I'm attending DevTeach 2009 in Vancouver and saw my colleague Ted Neward give a talk on this subject.

What the argument boils down to is this: good solutions architecture should enable success by default. The goal seems clear, but getting there is the tricky bit. Practicing good solution's architecture (according to Ted) involves multiple dimensions including:

  • Understanding technical and business requirements

  • Understanding constraints, like budget and release dates

  • Reassessing the two points above constantly

  • Aligning and educating your team with the solution architecture

Architect's are educators. They are technically proficient, and are capable
of backing up ideas or diagrams with code. They work with the business to
understand both the functional and non-functional requirements. They can
help the business get what they want sooner, and don't introduce technical
complexity without good reason.

Architecture is one of those topics in software development that screams with controversy. Ted mentioned today a the biggest reason why is that software development as a science is still in its infancy. Compare us to other disciplines like building architecture, which has been around for thousands of years. We've really only been on the map for the past fifty.

I'm encouraging Ted to publish his slides, because the idea of an Architectural Catalog or Taxonomy is going to be essential for us, as an industry, to grow up. I want to echo the need for software developers to start thinking about architecture beyond just what frameworks we're using, but understanding the business and team constraints as well.

Let's hope we get to a software architecture renaissance soon. Could you be the next Michelangelo of software?

Friday, April 24, 2009

Joe, Jonathan, and jQuery

Update: The presentation and code can be downloaded here

What do these three things have in common?

A presentation in Calgary at the .NET Users group. If you are around on Thursday evening at 5:30pm, April 30th, come join me, Joe Poon at the Nexen Building for an introduction to jQuery and how to get make all your AJAX problems go away with a simple $.post()!

Details for the event are here. See you there!

Tuesday, March 10, 2009

Speaking at Techfest 2009

I just signed up to speak at Techfest 2009 in Calgary. I'll be doing two sessions one in the morning (Dev Track) and one in the afternoon (Agile Track).

Here is a link on how to register:

The two topics will be: Test Driven ASP.MVC and Iteration Planning and Tracking. It should be a lot of fun, so if you're around on Saturday March 21st, please do come.

Saturday, February 14, 2009

Testing the Http Session in ASP.NET MVC Framework

Update: You can actually use the MockSession provided in MVCContrib on Codeplex, since it does everything that this article describes and more.

I've been working with Microsoft ASP.NET for over 5 years now, and frankly nothing has impressed me more than the new ASP.NET MVC Framework that is now in Release Candidate.

One of the main advantages of the framework is testability, however one problem I ran into early on is how to test the Http Session. The only way I found on the web to test the session was to mock out HttpSessionStateBase and that just looked ugly to me.

In my past experience in ASP.NET I've always injected my own Session object to a Presenter class, which made it easier to test without a whole lot of ceremony (other than the Model-View-Presenter pattern itself).

My solution was to create an abstract class that extends System.Web.Mvc.Controller which allows for a testSession to be set from unit tests. Meanwhile the real HttpSession is returned only when the testSession is null (i.e when running in a web server)

You'll need to extend SessionableController if that particular controller wants to use the session, and create a parameterless contructor.

To test these SessionableController's you'll need to create a new SessionStub object and pass it into the SessionController.

public abstract class SessionableController : Controller
//only used when testing, otherwise it's null
private readonly HttpSessionStateBase testSession;

//used by ASP.NET
protected SessionableController()

//used for testing
protected SessionableController(HttpSessionStateBase state)
testSession = state;

public new HttpSessionStateBase Session
get { return testSession ?? GetRealHttpSession(); }

private HttpSessionStateBase GetRealHttpSession()
new HttpSessionStateWrapper(

public class ShoppingCartController : SessionableController
private ShoppingCart cart;

//used by ASP.NET
public ShoppingCartController()
//used by unit tests
public ShoppingCartController(HttpSessionStateBase session) : base(session){}

// GET: /ShoppingCart/

public ActionResult Index()
if (Session["cart"] == null)
Session["cart"] = cart = new ShoppingCart();
cart = (ShoppingCart) Session["cart"];

if (cart.NumberOfItems() == 0)
cart.AddItem(new ShoppingCartItem("shirt", 10.99M));

return View(cart);

public class ShoppingCartTest
public void Should_Be_Able_To_Use_A_Stub_Session_()
new ShoppingCartController(new SessionStub()).Index();

//Pretends to be an ASP.NET Session, but really is just a list.
//Helps testing controllers without a web container.
internal class SessionStub: HttpSessionStateBase
private readonly Dictionary<string, object> sessionContents =
new Dictionary<string, object>();

public override object this[string name]
return sessionContents.ContainsKey(name)
? sessionContents[name] : null;
set { sessionContents[name] = value; }

Tuesday, January 20, 2009

Stages of Spirituality - Ignite Bangalore

Just gave a 5 minute talk at Ignite Bangalore last Friday. The organizers posted my presentation on slideshare and the video of the session.



Sunday, January 11, 2009

A brave new world

So here we are. Western civilization in the 21st century. 12 billion web pages, six billion people, and Septillion Zimbabwe dollars ($1 CAD = ~8 million ZWD as of time of this post).

I remember taking a physical anthropology course many years ago that discussed the evolution of the human brain (or skull rather) and how over the course of 2 million years we essentially have only increased our brain size by about 450 cubic centimeters or about 33%.

So with all that extra space most of us have managed to break away from millions of years of hunter-gatherer society and enter the information age. However, despite all the boons of science, technology, religion, and art why are so many of us completely lost? I know that I often find myself asking the question "what the hell am I doing with my life?"

Things kinda fall apart when you work everyday in busy downtown environments, keeping up with the Jones, and losing ourselves in fetishism of product. I know that I spend far too much time obsessing about the "next upgrade" to my 21st century hot rod, my personal computer.

It's like the meaning of our lives have just turned into some movie about a super hero that lives an 'ordinary' life but has no idea of the super powers he has. Except in this movie we never figure out the super powers and instead just live on auto-pilot wondering where the true meaning of life will come at us.

So where does that leave us? How can we ever get that sense of meaning to be consistently in our life?

Exploring these questions is one of the purposes of this blog, and I hope to share the answers that work (and don't work) for me.