Xamarin User Group San Diego - Building Cross-Platform Native Apps with Xamarin & MVVMCross.
We meet every second Thursday of the month to discuss Xamarin's past, present, and future. For more Meetup details or to join the group visit bit.ly/XamarinUserGroupSanDiego.
Introduce MVVM & How to implement it in your iOS app
Xamarin user group san diego - mvvm cross
1. Welcome To The 2nd San Diego
Xamarin User Group Meet-Up
April 9th, 2015
2.
3. Agenda
1. What is MVVM?
2. What is MVVM Cross?
3. Advantages / Disadvantages
4. Demo
5. Q&A
6. Bonus
4. 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)
6. 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
7. 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.
8. 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.
9. Advantages / Disadvantages
Advantages:
• 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