The Tyranny of Horizontal Architectures (and How You Might Escape): Part 2
In part 1 of this series , I talked about the pains that I and my colleagues have experienced when working in code bases that used N-tier data-centric architectures. In this post, I will detail one approach which has allowed me to escape that madness. Lasagna Code We've all heard the term "spaghetti code". But there's also "lasagna code": "The object-oriented version of spaghetti code is, of course, 'lasagna code'. Too many layers." - Roberto Waltman — Programming Wisdom (@CodeWisdom) February 24, 2018 I use that statement to remind myself that layers can sometimes do more harm than good. That also reflects my experience. Of course, it's not really the number of layers that's the problem, but rather, how the dependencies between those layers are set up and what abstractions those layers represent. Consider this familiar diagram of a data-centric N-tier architecture: Or even a diagram of a DDD-inspired but sti...