Craft & Graft

View Original

Android Data Binding with Recycler Views and MVVM: a Clean Coding approach

I love to envision and create clean architectural solutions. One of the many responsibilities of a Software Architect includes giving guidance on architecture and design patterns.

Sometimes, creating a code implementation while adhering to patterns can be confusing. This is especially true with Android and Model-View-Model (MVVM), where Software Architects and Engineers application of the different classes in how they apply to the three components of MVVM. One concrete example is MVVM with Android Recycler Views, a type of list, their adapters, and their items. Sorting it out may not as straightforward without realizing a good architectural solution.

In January of 2018, I wrote a blog as an introduction of clean coding with Recycler Views and MVVM. It provides a clear explanation of MVVM in combination with Recycler Views and Google’s data binding library.

If you would like to read the blog, it can be found here and the source code here.

Google’s architecture components had not been mentioned nor released at that time. Therefore, there is no mention nor usage of the Google’s ViewModel classes in the blog and Github repository.