#4 ViewModelFactory Tutorial -Android ViewModelFactory example-Android Dependency Injection tutorial

Опубликовано: 09 Февраль 2020
на канале: Munir Hoque
3,297
37

Today our Topic is ViewModelFactory. ViewModelFactory is a specially designed class which follows the Factory Design pattern and creates ViewModel classes for us.

Full Playlist link :    • Android ViewModel and LiveData  
Third part(Android LiveData Tutorial) link -    • #3 Android LiveData Tutorial - Androi...  
Second part(Android ViewModel Tutorial) link -    • #2 Android ViewModel Tutorial - Andro...  


ViewModelFactory also provides some kind of very simple and modular dependency injection without using any Dependency Framework which is useful for small and medium size project. On a side note, please do not use ViewModelFactory as dependency injection in large projects, use any framework like Dagger or CodeIn instead. So,in this tutorial we will see how to use ViewModelFactory and why particularly it is useful. If you already familiar with Factory Design pattern then it will be easy to understand. But if you not, don’t worry, I have explained the Factory Design pattern later in this tutorial with example.
I demonstrate a super easy and simple way to write your Dependency Injection Implementation which does not require Dagger 2. Using AndroidViewModel, you can write a Dependency Injection Container is a few lines of code.
Since this project uses ViewModelProvider.Factory, I also show you how I wire that up.

Source code for this tutorial: https://bit.ly/2Sxead7
Factory Design Pattern example - https://www.educative.io/edpresso/wha...
FaceBook Learning group :   / 545337292987590  

#AndroidViewModelFactory
#AndroidViewModelFactoryTutorial
#AndroidViewModelFactoryDependencyInjection
#AndroidAppDevelopmentTutorial
#AndroidDependencyInjection


На этой странице сайта вы можете посмотреть видео онлайн #4 ViewModelFactory Tutorial -Android ViewModelFactory example-Android Dependency Injection tutorial длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Munir Hoque 09 Февраль 2020, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 3,297 раз и оно понравилось 37 зрителям. Приятного просмотра!