Android Architecture Components (parte din Jetpack) sunt biblioteci care ajută la construirea aplicațiilor robuste și ușor de întreținut — inclusiv ViewModel (stare conștientă de ciclu de viață), LiveData/StateFlow (date observabile) și Room (o abstracție a bazei de date). Ele suportă modelele de arhitectură recomandate.
ViewModel — ținător de stare conștient de ciclu de viață
VIEWMODEL holds UI-related state and logic, SURVIVING configuration changes:
→ state stored in a ViewModel SURVIVES screen rotation (the activity recreates, but the
ViewModel persists) → solves the lost-state-on-rotation problem
→ separates UI logic from the Activity/Fragment (the View just observes/displays)
