Home » everythingelse | the blog

Onion Architecture

19. July 2011 by clinton 11 Comments
Cut onion

Image via Wikipedia

I like a good paradigm challenge, so when I stumbled upon this series post by Jeffrey Palermo on software architecture using an Onion layered analogy as opposed to the traditional Stacked layer analogy approach of separating concerns, I was hooked. He talks about something I’ve been battling to put my finger on for years.

The traditional, stacked, layered approach to software architecture was intended to create loose coupling has always had that noble goal – to separate concerns to a level of total layer autonomy. All the projects I’ve worked on follow this principle, yet every time it comes to an architecture overhaul it becomes clear just how tightly coupled these layers have become.

I’ve been doing a fair bit of MVC3 work lately and I like the way the .Net framework is heading, the little things like Convention over Configuration for dependency injection just make programming that much easier and step closer to purer loose coupling. This is where I stumbled onto this view of looking at dependent layers.

I believe focusing  on Domain Driven Design and development is the right approach to creating an agile project that can adapt the users needs readily. That's why I like the Onion Architecture, It focuses on the clear restraint – the Business domain’s needs, no solution can un-couple from it’s requirements – otherwise it becomes something it was never intended for.

The Onion approach builds dependencies outwards from this absolute constraint and approaches projects more realistically. Read the three part series below, Jeffrey does a great job of explaining the thought process.

Jeffrey Palermo on Onion Architecture:  http://jeffreypalermo.com/blog/the-onion-architecture-part-1/

Enhanced by Zemanta