Reviewing the layered architecture
Layered architecture, in my view, may emerge when a group of developers in charge of a project do not stop to think about which kind of architecture is more suitable for the software they want to develop. I have observed this scenario in projects where without conscious team planning, the code structure would evolve to some level of separation of concerns where the presentation/API code would be somewhat isolated from the business and infrastructure code. You would not see core business logic in the classes responsible for providing a REST endpoint, for example. You may notice, in such projects, packages named model
, repository
, service
, and controller
as hints to a system based on the layered architecture ideas. They are hints because each of those packages usually represents an intent to allocate a specific software responsibility. The code present in the model
package is used to represent database entities. The repository
package contains classes...