Tuesday, December 16, 2008

After many months of work, we've released the patterns & practices Application Architecture Guide - http://www.codeplex.com/AppArchGuide. You can download the pdf or you can view it all on the web, whichever is easier for you.

This is a 381 page playbook to designing well architected applications on the Microsoft .NET platform. It covers web applications, mobile applications, rich client applications, services and rich internet applications (like Silverlight). The guide is a distillation of many lessons learned from architecture experts both internal and external to Microsoft. It’s principle-based and pattern-oriented to provide a durable, evolvable backdrop for application architecture that you can use for many years to come.

Some key features of the guide:

Canonical app frame - Describes at a meta-level, the tiers and layers that an architect should consider. Each tier and layer is described in terms of its focus, function, capabilities, common design patterns and technologies.

App Types - Canonical application archetypes (such as web application or rich client application) are used to illustrate common application types. Each archetype is described in terms of the target scenarios, technologies, patterns and infrastructure it contains.

Arch Frame - A common set of categories for hot spots for key engineering decisions. These include categories such as authentication and authorization, caching, state management, composition, configuration, transactions, validation, workflow and more.

Quality Attributes - A set of quality attributes that shape your application architecture, such as performance, security, scalability, manageability, reliability and more.

Principles, patterns and practices - Using the frames as backdrops, the guide overlays relevant principles, patterns, and practices, such as model view controller pattern, data transfer objects, service gateway, facade and more.

Technologies and capabilities - A description of the Microsoft platform and all the relevant technologies. For instance we provide guidance about which data access technologies to use, which UI and presentation layer technologies are best suited for your scenario, and when to use WCF vs. ASMX.

If you are an architect or a developer on the .NET platform, I highly recommend you pick it up. Its free, so you have nothing to lose!

Friday, December 12, 2008

Inspired by the Zen of Results E-Book, the members of my team had a spirited discussion on personal productivity. The book contains great information but it didn't address a burning question on the mind of one of my team-mates:

Interesting --- but I think it's overly simplistic and misses the hard stuff.

To me the challenge is really: how to best manage the inevitable disruptions to my plans? How do I balance working towards the objective against the immediacy of a 'crisis' -- and not just poor planning on my part. I'm not abrogating my responsibilities, but I'm unwilling to accept that failure to achieve an outcome is a negative. Is that excuse making?

I think the key insight from the Zen of Results is that you need to free yourself from your tasks, free yourself so you can focus all of your energy on the creation and delivery of real value. I've seen many people create tasks with some goal in mind (the value) and then stick to those tasks through hell and high-water without realizing that the completion of the tasks is no longer leading them to the goal. I really like the workkflow in the Zen of Results because it reminds you to think about each week as a way of creating and delivering value and reminds you to reflect on your results each week to see how you can improve.

Here are the techniques I use to help me focus on results and avoid falling in the trap of becoming overly attached to my backlog of tasks:

I keep a list of my strategic goals in Evernote. These are my large, long-term objectives that may span many months or even years. I use these to remember what my big targets are.

Every Monday I build a list of the outcomes I want to achieve for the week. These map to the strategic goals and are usually sub-goals that are achievable within a week's time.

Every day I create a list of tasks I want to accomplish. These are short-term activities that I can accomplish within the next 48 hours. As I finish the tasks I delete them and then replenish them the next day.

Every Friday I review the results I achieved and reflect on how they differ from what I set out to accomplish for the week.

When I, or my team, misses a planned outcome I do some investigation to figure out why. I don't look at the missed result as a failure, but rather an opportunity to improve planning and thinking for the future. I've found missed outcomes are usually caused by one of the following:

I misjudged scope and got less done than I hoped for.

I was surprised by a new priority that I hadn’t planned for.

The planned outcome was wrong and I needed to adjust mid-week.

If I understand the 'why' then I can plan more effectively in following weeks. Its important to remember that things don’t always go according to plan – you have to plan for that too. Outcomes are your target, like any marksman you will not always hit them 100%.

This led to a new question from the team:

I guess I'm balancing the incremental steps required to achieve a major objective (like iterations building to a release) with the 'crisis du jour' syndrome that can overwhelm. Sometimes (not often) there are more unplanned activities than planned ones -- endangering the critical goals for sure!

so -- say you've had 2 weeks where you accomplish nothing that has meaning to you -- not one of your objectives -- what's your trick for trying again?

I think in a situation like that you need to first ask yourself what happened. Were your planned outcomes interrupted by new outcomes that were truly of higher priority? In other words did you sacrifice two weeks but in the end it added more value than if you had stuck to your planned outcomes? If so, it was the right choice. On the other hand, it could have felt necessary but still wasn’t worth it – we get trapped in these kinds of binds from time to time due to randomization, poorly planned objectives, fuzzy priorities, etc. Or it could be the work needs to be done but it should be done in parallel and you aren’t the right owner – delegate!

This is how I think about it:

Reprioritize

Delegate

Defer

Reprioritization works if you really need to drop everything and the new work is critical path. Delegation works if it is important but can be done in parallel by someone else. Deferring the work is a good fit if the crisis is not really a crisis and it can be set aside to cool down. I found many times a crisis isn’t as big of an emergency as it seems and it can be slotted into the work queue to be deferred till later. If there is an ongoing stream of unplanned crisis that continue to take top priority, thereby pushing back other important work, then there isn’t much point in planning, right? You need to understand root cause and attack that first so that the environment is conducive to planning again and is no longer anarchy and chaos. This is similar to the change frame I wrote about in an earlier post.

Prioritization is critically important to make sure you are focused on the right tasks each day. Focusing on outcomes is a good technique, but there were a few other techniques discussed, for instance:

If too many things are “ultra high priority” I have a hard time prioritizing the things at the top of my list. When this happens I find that it becomes even more important for me to feel like I’m making progress, or I can spiral into a pit of despair. When this happens the best thing to do is to select something from your high-pri list that you know you can really sink your teeth into quickly. As they say, even the longest journeys begin with a single step, don’t focus on the how far away the destination is, focus on the steps.

Another technique I use is to walk away from my computer alone, or close my eyes, for 5 min. This gives me just enough time for the really urgent stuff to rise to the top, and the other stuff to fall away. It’s a short enough time that I can convince myself to do it, without feeling guilty for doing something else.

Once I’m back down to a manageable list of tasks I prioritize again, and group small tasks together in 30-60 min blocks, then prioritize those as one unit. I find that if I don’t group small tasks together that they’ll fall off my radar and won’t get done. This also reduces context switching which can be a killer.

At this point I have my über-list of tasks that need to get done, in the morning I look at my list, reprioritize, and take my first step.

Key Insights

Focus on outcomes first, tasks second.

Understand how what you are doing will help you or your team create and deliver value.

Create a workflow that will help you stay focused on delivering value.

If you are having trouble hitting your goals, understand why and then use a technique to improve your results - don't spiral into the pit of despair.

Results build upon results - if you are losing effectiveness, find something you know you can sink your teeth into and get results quickly. Build on that momentum.