Skip to main content

Command Palette

Search for a command to run...

Thoughts on MVC Pattern

View <-> Controller <-> Model

Published
1 min readView as Markdown
A

Enjoy researching, debugging, problem solving.

I work in the field of iOS development.

Life started with MVC long time ago. It was clear how to separates responsibility between different components.

So the View component is just to communicate with the user and display data, then the Model component will be the data required by certain views in specific screen, and Controller is the intermediate component running between View and Model components.

The Controller component took all responsibilities, setup views, handle UI events, communicates with data sources, etc.., until we reached the point of Massive-Controller issue that does almost everything.

Some people avoid this Massive-Controller issue by making the Model component takes responsibility off of the Controller, and makes any necessary requests to data sources (database, api, etc..) .. this kinda makes MVC works efficiently than turning it into Model-View-MassiveController.

Gradually, other patterns are made to take more and more of responsibilities off of the Controller component.

NOTE: In iOS, the ViewController will take the role of the Controller component in MVC pattern.

---- End of post.

Thoughts on MVC, MVP, MVVM, and Viper Patterns

Part 1 of 1

In this series, I will share basic thoughts on some patterns we - iOS developers - use to structure our project like MVC, MVP, MVVM, and Viper.