Onion Architecture?

13 commentsWritten on July 29th, 2008 by
Categories: Software Development

Jeffrey Palermo describes the Onion Architecture in this great post. If you haven't read it yet, read it now. If you don't like it, you just might be in the wrong business :)

The only thing i don't like about it is the name... honestly, onion architecture? I once referred to an architecture as being comparable to an onion, in the sense that as i went through the layers and got exposed to the internals, i got more and more tears in my eyes. You don't want people getting thoughts like that when you're describing your preferred architecture. We really do need a better name for this :)

Don't look at me though... i suck at coming up with good names :)

  • http://hsidev.wordpress.com Nathan

    Ha! I completely agree. Wonderful architectural description, awful name. Reading the header of the post you assume you’re about to read a description of how NOT to design a system, and are quite surprised to learn it is the opposite. Plus, onions don’t have a core, just layers. Peel the last layer and your hands are empty. Even so, it’s hard to come up with a better name.It is hard to imagine the name catching on. I can’t really picture reading resumes with “Experience building onion based systems” or “Solid understanding of onion architecture”

  • http://davybrion.com Davy Brion

    heh… or Onion Driven Development specialists

  • Gonzalo

    I feel the “Onion Architecture” is just one way of using a DSL design. Any comments?

  • http://davybrion.com Davy Brion

    @Gonzalo:

    what exactly do you consider a DSL design?

  • Gonzalo

    Basically when you create your apps to solve a specific problem. This will make your design base on a specific “Domain Model” and creates “Domain Services” the DB or storage source become “external”

  • http://davybrion.com Davy Brion

    ah ok… i thought you were talking about Domain Specific Languages

    i do agree that the Onion architecture is a way of doing Domain Driven Design, and that there are certainly other ways of doing so.

  • http://elegantcode.com Jan Van Ryswyck

    The book “The Pragmatic Programmer” talks about an orthogonal architecture, and this is just derived from plain old OO design reinforced by Eric Evans DDD. Onions kinda smell and make you cry if you want to peal them, so maybe “orthogonal architecture” fits the bill?

  • http://davybrion.com Davy Brion

    i dunno… you’re right, but it has a bit of an academic ring to it…

  • Pingback: So you want to learn NHibernate - Part 0.5, Prerequisites (or NHibernate = Marijuana.NET) | The Freak Parade

  • steinjak

    I just felt that somebody ought to mention Cockburn’s Hexagonal Architecture here, which I feel is somewhat related to this. When trying to structure an architecture according to those principles, we ended up doing basically the same thing as in the “Onion architecture”.

  • Martin

    >> Don’t look at me though… i suck at coming up with good names

    This is indeed true! Have you ever tried to google anything useful about agatha (not agatha christie) ;-)

  • http://davybrion.com Davy Brion

    @Martin

    i gave up on that :p

  • Geert

    When Shrek said “Ogres are like onions”, Donkey suggested cake as an alternative name.
    You could call it a cake architecture? :-)