Category Archives: Architecture

Combating the lava-layer anti-pattern with rolling refactoring

Mike Hadlow blogged about the lava-layer anti-pattern, describing, which I have ranted about in nearly every talk I do, the nefarious issue of opinionated but lazy tech leads introducing new concepts into a system but never really seeing the idea … Continue reading 

Also posted in Design | 23 Comments

Generic variance in DI containers

DI containers, as complex as they might be, still provide quite a lot of value when it comes to defining and realizing the composition of your system. I use the variance features quite a bit, especially in my MediatR project … Continue reading 

| 29 Comments

MediatR hits 1.0

I’ve been using a project I wrote/borrowed/stole from a number of internal projects and existing libraries (thanks Matt) for well over a year now, and are releasing to 1.0. MediatR helps turn complex code into simplified request/response interactions, encapsulating queries, … Continue reading 

| 19 Comments

The value proposition of Hypermedia

REST is a well-defined architectural style, and despite many misuses of the term towards general Web APIs, can be a very powerful tool. One of the constraints of a REST architecture is HATEOAS, which describes the use of Hypermedia as … Continue reading 

Also posted in REST | 17 Comments

Container Usage Guidelines

Over the years, I’ve used and abused IoC containers. While the different tools have come and gone, I’ve settled on a set of guidelines on using containers effectively. As a big fan of the Framework Design Guidelines book and its … Continue reading 

Also posted in Dependency Injection | 46 Comments

Tackling cross-cutting concerns with a mediator pipeline

Originally posted on the Skills Matter website In most of the projects I’ve worked on in the last several years, I’ve put in place a mediator to manage the delivery of messages to handlers. I’ve covered the motivation behind such … Continue reading 

Also posted in Design, Domain-Driven Design | 27 Comments

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 | 42 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 | 37 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