Architecture Components – let's make Android great again

Android great again Google I/O 2017 brought a new package of outstanding news. In my point of view, one of the most relevant news were Architecture components, a new bunch of libraries that help developers design apps with testability, maintainability and clean code.

Room

This is my favorite library of Architecture Components, surely. Room is an object mapping library that let the code clean and collaborate with SQL queries. Furthermore, the library provides SQL queries validation compilation time, annotations and observables for database changes. I knew this today would come, a day that Google will release a library for persistence such Apple offer for iOS (Core Data). Hereafter I have no doubt Room will be a reference for the persistence layer although there are tons of similar libraries such as ORMLite, Active Android or GreenDAO.

ViewModel

Live Data

it is responsible for listen and propagate data changes: an observable data holder It allows broadcasting of data changes all over the architecture layers taking into account all system issues eg. memory leaks.

Lifecycle Owner - Lifecycle

It allows the creation of lifecycle-aware components which are able to adjust itself automatically according to the current lifecycle. This feature is possible because Lifecycle owner associates a class to the lifecycle via an abstract class called getLifecycle().

Further Details

I recommend this project which Google team implemented samples of Architecture Componentes and this video from Google I/O.