Category Archives: Architecture

Proper Session/DbContext lifecycle management

Most “heavy” object-relational mappers (ORMs) have an interface that provides more than just easy querying of the database. They also are implementations of two key patterns: Unit of Work Identity Map For NHibernate, this is the ISession interface, and for … Continue reading 

Also posted in Patterns | 41 Comments

Put your controllers on a diet: POSTs and commands

Previous posts in this series: Redux Defactoring A survey GETs and queries In the last post, we looked at encapsulating the interesting part of GET actions (taking request parameters and building a model) into individual encapsulated query objects and handlers. … Continue reading 

Also posted in ASP.NET MVC, Patterns | 33 Comments

Put your controllers on a diet: GETs and queries

Previous posts in this series: Redux Defactoring A survey In the last post, we surveyed the field to determine the path forward. Looking at our controller (and others), our controllers aren’t too messy, but they’re well on their way. On … Continue reading 

Also posted in ASP.NET MVC, Design | 63 Comments

Put your controllers on a diet: a survey

Previous posts in this series: Redux Defactoring In the last post, I removed all the abstractions and layers from my application in order to provide a better view on what my next steps should be. This is like climbing to … Continue reading 

Also posted in ASP.NET MVC, Design | 9 Comments

Evolutionary architecture boundaries

At Headspring, we’re fairly obstinate in our approach in evolving a system’s design and architecture over time. As a consulting company, we get to see a LOT of different codebases, and while it may be selection bias, we are generally … Continue reading 

Also posted in Design | 3 Comments

Scaling lessons learned–from 0 to 15 million users

The bulk of my time in the last three or so years at Headspring has been building and architecting a loyalty reward system (think Best Buy Reward Zone). I’ve worked on Very Large Systems before, Fortune 50 e-commerce sites, but … Continue reading 

| 11 Comments

Curbing long tail design

One of the perks of my job (and talking to a lot of folks) is that I get to see a lot of people’s actual code. Not gists, blog examples, or GitHub playgrounds, but real, actual, production code. Some code … Continue reading 

Also posted in Design | 21 Comments

Limiting your abstractions

It’s been almost 3 years since I first wrote about moving away from the Repository abstraction. Since then, I’ve gone more or less full-bore without any concept of a repository in the systems I’ve built. I haven’t removed existing repositories, … Continue reading 

| 38 Comments

Evolutionary Project Structure

I used to care quite a bit about project structure in applications. Trying to enforce logical layering through physical projects, I would start off a project by defaulting to building an app with at least two projects, if not more. … Continue reading 

Also posted in Domain-Driven Design | 78 Comments

ORM techniques for legacy databases

One of the reasons folks typically go with a hand-rolled ORM (i.e., using ADO.NET by hand) is the assumption that ORMs don’t work well with legacy databases or databases designed in isolation from any sort of object model used to … Continue reading 

Also posted in NHibernate, SQL | 22 Comments