xamarin user group san diego - mvvm cross

14
Welcome To The 2nd San Diego Xamarin User Group Meet-Up April 9th, 2015

Upload: seamgen

Post on 15-Jul-2015

101 views

Category:

Documents


2 download

TRANSCRIPT

Welcome To The 2nd San Diego Xamarin User Group Meet-Up

April 9th, 2015

Agenda1. What is MVVM?2. What is MVVM Cross?3. Advantages / Disadvantages4. Demo5. Q&A6. Bonus

What Is MVVM?• Model, View, ViewModel

• Traditionally iOS is developed in MVC (Model, View, Controller)

• Everything can be tightly coupled (delegation pattern)

• Easy to do wrong

• Traditionally Android is developed in ???

• Tight coupling between views (AXML) and logic (views get inflated)

What Is MVVM?

http://en.wikipedia.org/wiki/Model_View_ViewModel

What Is MvvmCross?• a.k.a. MvX

• applies MVVM pattern to

• Xamarin.iOS, Xamarin.Android, Windows Universal

• Xamarin.Mac, Windows Store, …

• IoC and Dependency Injection are core concepts

• Makes for easily testable code

• https://github.com/MvvmCross/MvvmCross

What Is Inversion Of Control?

• http://en.wikipedia.org/wiki/Inversion_of_control

in traditional programming, the custom code that expresses the purpose of the program calls into reusable libraries to take care of generic tasks, but with inversion of control, it is the reusable code that calls into the custom, or task-specific, code.

What Is Dependency Injection?

• http://en.wikipedia.org/wiki/Dependency_injection

the client part of a program which uses a module or service doesn't need to know all its details, and typically the module can be replaced by another one of similar characteristics without altering the client.

Advantages / DisadvantagesAdvantages:

• Interchangeable code modules

• Supports test driven development (TDD)

• Core pattern to follow (Code Review)

• DataBindings

Disadvantages:

• It is a non-native pattern for iOS and Android

• core 3rd party dependency

• Lot’s of glue code for Custom Bindings (Value Converters)

• documentation contains a high amount of kitten

DEMO

Q & A

Bonusatp.fm

Hosted by Marco Arment, Casey Liss, John Siracusa

hanselminutes.com

Hosted by Scott Hanselman

Next Meet-Up• May 14th, 2015

• Same Place

• Same Time

• Less Kitten

Thank Youseamgen.com/blog

github.com/seamgen/mvvm101