Skip to main content

MVC

Usage of MVC

  • When there is a data in the smallest form try to make it as a model
  • If there is a number of multiple data try to make a model that will manage all the smallest models

Data Modeling

  • Think of the data that is being used in the app
  • Think of visual representation of all the things in the app
  • Think of all the possibility of the app and data would be using in it
  • Think of how data is needed in the app
  • Think of how model will have the functionality in it
  • Think of how all the methods that would be needed to interact with the data
  • First start with a simple object and later think of the class

View

  • View does not have any logic
  • View should not be interacting directly with the data

Controller

  • The most basic functionality of the controller is to take data from model and give it to the view to render it
  • Controller should not take some data and mange it by itself