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

Using MVVM with Android Data-Binding

Avatar for Quan Vu Quan Vu
November 07, 2015

Using MVVM with Android Data-Binding

Avatar for Quan Vu

Quan Vu

November 07, 2015

Other Decks in Programming

Transcript

  1. Vũ Huy Quân (Rain Vu) • Member of APIDEZ •

    I am a developer for 2 years /nongdenchet (Quan Vu) [email protected]
  2. MVVM with Test 1. Model - View - ViewModel 2.

    Unit Test 3. Demo 4. Question and Answer
  3. ViewModel Have no information about View. Represent the state of

    View. Contain commands. Notify View and update Model.
  4. Advantages Separate view logic and business logic. Work independently on

    each layer. Loose coupling. Easy to write unit test.
  5. Disadvantages O v e r k i l l fo

    r s i m p le application. Harder for debugging.
  6. Why need writing unit test? Reduce bugs in existing features.

    Good documentation. Reduce cost of change. Improve design. Allow refactoring.
  7. Separate concern of UI code. Fully describes state of View.

    Act like POJO class. Easy to write unit test. ViewModel