DEV Community

Discussion on: Explain how MVVM architecture work like I'm five.

Collapse
 
justgage profile image
Gage

Although this may not be true, one to think about it is:

  • Model: the state of the app in the most correct form
  • View Model: Model transformed to be more convenient for the view. Example nesting the comments for a post under the post even if they aren't saved that way I'm the model
  • View: renders the view model to HTML out whatever

Using a "ViewModel" or sometimes called selectors is a mildly common pattern in Redux and Elm. Although it's only needed for very complex interfaces and often used in conjunction with other patterns.

I'm no expect, take this with a grain of salt.