DEV Community

spencer-w-mathews
spencer-w-mathews

Posted on

2 1

MVC-What is it?

MVC is a software design pattern that separates the data, layout, and routes. This creates a division of labor or "separation of concerns" that allows for easier maintenance.

Model

The model decides what data the app should hold. If data changes then the model will tell the view.
In a rails/react application the models would be located within the app folder and they would be written in ruby.

View

The view is the screen of the app the decides which data to display.
In a rails/react application this would be the react portion. The front-end which displays the data to the end-user.

Controller

The controller possesses logic with the ability to update the models and/or view in response to actions from the end-user.
In a rails/react application the controllers would be located within the app folder and they would be written in ruby.

Image description

sources: https://developer.mozilla.org/en-US/docs/Glossary/MVC

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay