Separation of concerns (SoC)
As its name implies, the idea is to separate our software into logical blocks, each representing a concern. A “concern” refers to a specific aspect of a program. It’s a particular interest or focus within a system that serves a distinct purpose. Concerns could be as broad as data management, as specific as user authentication, or even more specific, like copying an object into another. The SoC principle suggests that each concern should be isolated and managed separately to improve the system’s maintainability, modularity, and understandability.
The SoC principle applies to all programming paradigms and all levels of architecture, like modules, subsystems, and microservices, as well as classes and methods. In a nutshell, this principle means factoring a program into the proper pieces, meaning they are fit to interact with each other yet are as independent as possible: separated by concern.
By correctly separating...