MVC and Goal Flashcards
What does MVC stand for in software design?
MVC stands for Model-View-Controller. It is a design pattern used to develop user interfaces by separating program logic into three interconnected components.
What are the three main components of MVC?
- Model: Manages application data, logic, and rules. It is independent of the user interface.
- View: Represents information in various formats (e.g., tables, charts). It displays data to the user.
- Controller: Handles user input, processes it, and interacts with the model to update the view.
MVC Diagram
Model (Defines data structure) e.g. Update app to reflect item
View( Defines Display UI) e.g user click ‘add to cart’
Controller (contains control logic) e.g. receives update from view then notifies model to add item
What is the role of the Model in MVC?
The Model is responsible for handling application data. It receives input from the Controller and manages the data structure and business logic.
What is the role of the View in MVC?
View represents information in various formats (e.g., tables, charts). It displays data to the user.
What is the role of the Controller in MVC?
The Controller reacts to input, processes it, and interacts with the model to update the view.
What are the main goals of using MVC?
Simultaneous Development: Developers can work on different components (front-end and back-end) in parallel without blocking each other.
Code Reuse: Views can be reused across different applications, allowing for efficient handling of data display.
What are the benefits of using the MVC pattern?
MVC provides a separation of concerns, making it easier to manage and maintain code. It allows for better collaboration among developers and enhances code reusability.