Application Design Model MVC
Model View Controller
What is MVC?
MVC stands for Model-View-Controller. MVC is an application design model consisting of three interconnected parts. They include the model (data), the view (user interface), and the controller (processes that handle input).
MVC is a well-known model for designing web applications. Popular programming languages like, JavaScript, Python, Ruby, PHP, Java, C# and Swift have MVC frameworks that are used for web or mobile application development.
Why is MVC used?
By separating controllers, models, and views, it’s easier to change code in each of these layers. It offers simultaneous development, the developer is able to work in parallel on different components without affecting or blocking one another.
By creating higher-level components that are independent of each other, developers are able to reuse these components quickly and easily in other applications.
How does MVC work?
The Model is responsible for managing the data of the application. It receives user input from the Controller.
The View is responsible for the presentation of Model (data) in a certain format.
The Controller receives the user input and validates it, and then passes the input to the Model. It performs interaction on the model objects.
Advantages of MVC Framework:
- Parallel development
- Code reusability
- Multiple views for a model
Examples:
PHP
- Laravel
- CodeIgnitor
- Yii
- Symfony
Java
- Spark
- Stripes
- Apache Struts 1 / 2
Node.js
- Express.js
- Adonis
- Sail.js