Stop organizing your code by file type

What's the most popular style of organizing code you've seen in enterprise codebases? Personally, I've most often seen a solution that involves grouping all files by their type. Thus, for example, in an MVC system, all controllers, all services, all repositories, all POJOs, and so on are located together. Let's call this the "stacking" style of code organization .





, . .





- . "" . , , . , ( , ). , , .





, , , .





. : " API " " , ". , . , , , , .





, . . . , , .





, , , ( ), , , , - . "" . , , , , .





, "" , . , , . , , .





, , . , , , , , , ? , , , ? , , , ? - ! *. , . MVC.





"" , . , , "". , , "" .





- , "" , API, . , "", .





"" , - , . , , , .





, . , "", , .





The "semantic" way is not limited to a certain set of functional concepts, within which the code will be organized. Using it, the developer can create an unlimited number of semantic groups of files and classes, creating the most appropriate design model for a particular project.






The ways of thinking that are hidden in the models of the organization of the code are things that I think we don't think enough about. I would love to hear more from you about how you organize your code and how you think it affects developer behavior, mental model formation, or efficiency. Write about it in the comments!








All Articles