title: View related commands in MVVM application
body: <p>I was inspired by article <a href="http://blog.buildpath.de/javafx-decouple-the-view-and-its-behavior-to-create-a-testable-ui" rel="nofollow noreferrer">Decouple the View and its behavior to create a testable UI</a> and wanna rework my JavaFX application with <a href="https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel" rel="nofollow noreferrer">MVVM pattern</a>.</p>
  <p><a href="https://i.stack.imgur.com/IZhTD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IZhTD.png" alt="MVVM pattern" /></a><br />
  <sub>(source: <a href="https://i-msdn.sec.s-msft.com/dynimg/IC564167.png" rel="nofollow noreferrer">s-msft.com</a>)</sub><br />
  .</p>
  <p>Ideally <em>View Model</em> should be <em>View</em>-independent and be testable as usual Java class. Also MVVM uses <em>Command</em> conseption to change View Model from View. So Command implementation is a part of View Model implementation and may be simply tested.</p>
  <p>The questions is how Command should be implemented if it's result is a View changing? E.g. in View_1 I have a button after pressing on it a new View (e.g. View_2) should be created and shown. Should such Command be a part of a View and not be testable at all?</p>