Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ViewModel + DataBinding = <3

ViewModel + DataBinding = <3

Présentation pourquoi ViewModel et DataBinding se combinent bien entre eux.
Projet github associé : https://github.com/ccreusot/euroexchangerateapp

Avatar for Cedric Creusot

Cedric Creusot

March 03, 2020

More Decks by Cedric Creusot

Other Decks in Programming

Transcript

  1. "The essence of a Presentation Model is of a fully

    self-contained class that represents all the data and behavior of the UI window, but without any of the controls used to render that UI on the screen. A view then simply projects the state of the presentation model onto the glass." - Martin Fowler
  2. View - Interface graphique - Reçois les interactions des utilisateurs

    - Renvoie les interactions au ViewModel via le databinding - Connais la couche ViewModel
  3. ViewModel - Connais la couche Model - Expose les données

    du Model sous forme de propriétés - Expose des actions - Ne connais pas la View
  4. Build.gradle NB : À déclarer dans le module App et

    les modules utilisant Databinding