Hacker News new | ask | show | jobs
by atx42 1498 days ago
Why do we organize by shape, and not by function in our monoliths? We put all our controllers in a package, all our DB accessors in another package, all our "data objects" in another package. Even in OO languages like Java where we have package accessors that never get used because we layout our code such that package scope can never be used. We instead layout the code according to "shape".

When figuring out what to spin-off as a microservice, we do this by functionality. Why not just make it easier in the monolith and organize by functionality instead? Let's act like 4yr olds, not 3yr olds: https://pubmed.ncbi.nlm.nih.gov/12090481/

1 comments

The wording you are looking for is called "Vertical Slicing". After using it, I'll never go back to "shapes" anymore.
Thanks, I didn't know there was a name for it. But every single code example out there is an anti-pattern to this as far as I've seen.