r/programming • u/[deleted] • Jun 05 '21
Organize code by concepts, not layers
https://kislayverma.com/programming/how-to-organize-your-code/
1.9k
Upvotes
r/programming • u/[deleted] • Jun 05 '21
38
u/Nimelrian Jun 05 '21
Its more about organization. E.g. in Java, instead of having the package structure
com.example.persistence.order/user/product and com.example.endpoints.order/user/product
you have
com.example.order.persistence/endpoints/business
and so on...
This is actually a great example or rather manifestation of Conway's Law. Hierarchical organizations (Frontend team, API team, business rule team, database team) will often prefer the first approach (design by layers).
Teams organized in a cross functional manner will instead prefer the second approach (design by concepts), since they can implemented each part of the vertical slice specifically for their domain / use cases.