title: MVVM - view displaying information about multiple models
body: <p><em>NB: the question is about server-side web MVC</em></p>
  
  <p>In an MVVM(C) design, each View accesses its ViewModel. The ViewModel acts like a kind of bridge for a Model and also contains the state of the View.</p>
  
  <p>I can easily understands this with a simple example, like a view listing users: you would have a UserView which uses a UserViewModel which in turns is an abstraction of a UserModel for the view.</p>
  
  <p>Now imagine a web page that displays information about the users, the products, and the orders, all on the same page. And also a string summarizing the number of elements: "24 users, 8 products, 210 orders".</p>
  
  <p>How, in the above case, can the ViewModel only stick to one Model (assuming you have UserModel, ProductModel, OrderModel) as the view needs to display information about all three models? </p>
  
  <p><strong><em>Should a ViewModel include multiple Models and have a 1:n link between ViewModel and Model?<br></em></strong>
  <strong><em>Should a ViewModel include other ViewModels and keep a 1:1 link between ViewModel and Model?<br></em></strong></p>
  
  <p>It seems that framweorks like e.g. ZF2 (php) nest viewmodels into a main viewmodel:
  <a href="http://framework.zend.com/manual/2.0/en/modules/zend.view.quick-start.html#zend-view-quick-start-usage-nesting" rel="nofollow">http://framework.zend.com/manual/2.0/en/modules/zend.view.quick-start.html#zend-view-quick-start-usage-nesting</a></p>
  
  <p>PS: this question is about server-side web MVC (as opposed to javascript client-side MVC) and not specific to any programming language (although I am using PHP, so anything c# related like bindings, wpf or other .net components will be hard to grasp).</p>