Model-View-Controller (MVC) an architectural design pattern. The Model is where you handle the data and logic, the View is about how things look, and the Controller is like the coordinator, managing input and making sure everything works smoothly. It’s a way of organizing code so that it’s easier to understand and maintain. But do we see MVC being used in modern projects!
Enhanced MVC
Lets discuss some key Layers →
DAO ( Data Access Object ) / Repo Layer :- Its an abstraction layer for interaction with DB. Any DB integrations like CRUD operations will happen in this layer enhancing code maintainability and database independence.
Model / Entity Layer :- Its a logical view of how data is being stored / structured in the DB.
Controller Layer :- Forwards the route request to the business logic which is in the “Service Layer”. And prepares what response should user get based on the response of Service Layer.
There can be more layers depending on the Project needs.
You will be wondering where’s the “View” in this MVC !
In modern Web-Development projects “ View ”is being treated as a separate project, often developed using React, Vue.Js , Angular .
Some benefits of Enhanced MVC are -
- Dependency Management
- Scalability
- Reusability of Code
Follows the Modular programming approach.
Happy learning!
Top comments (0)