Search code examples
javascriptmodel-view-controllermvvmmv

In the MV* design pattern, is a model a single unit of data or all the logic that works with the data?


I have been trying to familiarize myself with this pattern, but I am not sure I am grasping the concept of the "Model" correctly.

For example, would a single cell in an array constitute one "Model" unit, or would the actual array and all logic for get/set on that array constitute one "Model" unit?


Solution

  • Model is all data, logic, and rules. So the actual array and all logic for get/set constitutes the model. There is no explicit sub-model unit per se in the MV design pattern.