I have used the MVVM pattern for the desktop app I am developing.
For the views, I have tried a wrapper for Java Swing and a wrapper for JavaFx. Eventually I chose JavaFx because I found easier giving styles to the UI and also because Oracle has integrated it in the SDK.
- Views only contains functions, they do not contain atoms.
- Each view only contains a public function: “construct-view”.
- Views do not use the Pub-Sub Events Manager.
- The View may listen (watch) for changes in the ViewModel.
- A View may depend on other Views and shall depend in one or more ViewModels.
- Views will use the Internationalisation component.
- ViewModels define their own records giving service to the Views.
- A ViewModel may depend on other ViewModel and shall depend on one or more Models.
- ViewModels may use the Pub-Sub Events Manager.
- The ViewModel also listen (watch) for changes in the Model.
- The records in the ViewModel tend to be composed by atoms enabling the bindings of the View.
- A ViewModel may keep a snapshot of calculated/aggregated data.
- A Model define its own records and may keep a snapshot of some of the data.
- Models read the information from the Web Services or from the DB.
- Models shall use a parser when the information from the source is not in Clojure format.
- Models use the Pub-Sub Events Manager.
- The records in the Model tend to be wrapped by an atom.