Skip to main content

MVC (Model-View-Controller) Pattern

Learn MVC (Model-View-Controller) Pattern (Enterprise Design Patterns, Enterprise Design Patterns) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is the MVC Pattern? MVC (Model-View-Controller) splits an application into three interconnected parts so that each concern - data, presentation, and control flow - can change independently without breaking the others. • Model - holds the application's data and business logic (e.g. a User or Order class). • View - renders the data to the user (an HTML page, JSON response, or console output). • Controller - receives input, talks to the Model, and picks which View to render. Why Split Things Up? Without MVC, a single class ends up doing data access, business rules, and rendering all at once...

More lessons in Enterprise Design Patterns