<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw" -->

---
title: We don't need ViewModels anymore. So shall we get rid...
description: Android ViewModels exist for more than just surviving configuration changes — they also handle process death via SavedStateHandle, enable separation of...
canonical: https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: We don't need ViewModels anymore. So shall we get rid off them? | daily.dev
og:description: Android ViewModels exist for more than just surviving configuration changes — they also handle process death via SavedStateHandle, enable separation of...
og:url: https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw
og:image: https://api.daily.dev/og/posts/oPBPK4nJW.png
og:image:alt: We don't need ViewModels anymore. So shall we get rid off them?
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# We don't need ViewModels anymore. So shall we get rid off them?

**[Philipp Lackner](https://daily.dev/sources/philipplackner)** · 20 min read · 4 upvotes · 0 comments

## Summary

Android ViewModels exist for more than just surviving configuration changes — they also handle process death via SavedStateHandle, enable separation of concerns, and make logic testable with fast JVM unit tests. Using `remember`, `rememberSavable`, or `retain` alone falls short in various ways: `remember` doesn't survive config changes, `retain` doesn't survive process death, and `rememberSavable` struggles with complex objects. While it's technically possible to build a custom stateholder class using the Compose `retain` API with a `SavableStateRegistry` to replicate ViewModel behavior, doing so requires significant boilerplate, hasn't been production-tested, and still doesn't address dependency injection. The conclusion is that reinventing ViewModels with plain Kotlin classes adds maintenance burden without meaningful benefit for most Android apps.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=DeVanKeIXag>

## Questions this post answers

### Why do we need ViewModels on Android instead of just using rememberSaveable?

ViewModels solve two Android-specific problems that rememberSaveable cannot fully address: surviving configuration changes and restoring state after process death via SavedStateHandle. rememberSaveable survives both but requires serialization logic that breaks down for complex objects, and unlike ViewModels it keeps state-updating logic tied to the UI, forcing slower, more brittle UI tests instead of fast local JVM unit tests.

_Developers weighing state management tradeoffs on Android can find deeper architecture discussions like this on daily.dev._

### What is the difference between the retain API in Jetpack Compose and using a ViewModel?

The retain API in Jetpack Compose survives configuration changes but not process death on its own, so it does not fully replace a ViewModel by default. Building a custom stateholder that mimics ViewModel behavior requires combining retain with a RetainObserver, a SaveableStateRegistry, and Navigation 3 NavEntryDecorators to scope the stateholder to a backstack entry and restore values after process death.

_Anyone evaluating whether to adopt newer Compose APIs over ViewModels can track these tradeoffs via daily.dev._

### What does Lifecycle version 2.11 change for ViewModels in Jetpack Compose?

Lifecycle 2.11 enables ViewModels to be scoped to individual composables rather than only to backstack entries, giving developers finer-grained control over ViewModel lifetime within Compose UI hierarchies. This builds on the existing ViewModel mechanisms for surviving configuration changes and process death through SavedStateHandle.

_Android developers adjusting scoping strategies after Lifecycle updates can follow related changes on daily.dev._

## Similar posts on daily.dev

- [Understanding retain: A New Way to Retain State in Jetpack Compose](https://daily.dev/posts/understanding-retain-a-new-way-to-retain-state-in-jetpack-compose-hga8inmvh) · ProAndroidDev · 0 upvotes · 0 comments
- [Android Architecture Is Quietly Moving Beyond ViewModel as a State Holder](https://daily.dev/posts/android-architecture-is-quietly-moving-beyond-viewmodel-as-a-state-holder-0e2pkua20) · ProAndroidDev · 12 upvotes · 0 comments
- [Process Death and SavedStateHandle in Android](https://daily.dev/posts/process-death-and-savedstatehandle-in-android-82qtjktll) · Atomic Spin · 0 upvotes · 0 comments

---

Tags: [#android](https://daily.dev/tags/android), [#kotlin](https://daily.dev/tags/kotlin), [#jetpack-compose](https://daily.dev/tags/jetpack-compose)

[View this post on daily.dev](https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"We don't need ViewModels anymore. So shall we get rid off them?","url":"https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw"},"datePublished":"2026-07-08T11:25:53.442Z","dateModified":"2026-09-13T20:27:56.437Z","description":"Android ViewModels exist for more than just surviving configuration changes — they also handle process death via SavedStateHandle, enable separation of...","image":"https://i.ytimg.com/vi/DeVanKeIXag/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/DeVanKeIXag/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Philipp Lackner","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Philipp Lackner","logo":"https://media.daily.dev/image/upload/s--WOEWUbRT--/f_auto/v1725038407/logos/philipplackner","url":"https://daily.dev/sources/philipplackner"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"android,kotlin,jetpack-compose","timeRequired":"PT20M","video":{"@type":"VideoObject","name":"We don't need ViewModels anymore. So shall we get rid off them?","description":"Android ViewModels exist for more than just surviving configuration changes — they also handle process death via SavedStateHandle, enable separation of...","thumbnailUrl":"https://i.ytimg.com/vi/DeVanKeIXag/sddefault.jpg","uploadDate":"2026-07-08T11:25:53.442Z","duration":"PT20M","url":"https://api.daily.dev/r/oPBPK4nJW","embedUrl":"https://www.youtube.com/embed/DeVanKeIXag"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Philipp Lackner","item":"https://daily.dev/sources/philipplackner"},{"@type":"ListItem","position":3,"name":"We don't need ViewModels anymore. So shall we get rid off them?"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/we-don-t-need-viewmodels-anymore-so-shall-we-get-rid-off-them--opbpk4njw#faq","mainEntity":[{"@type":"Question","name":"Why do we need ViewModels on Android instead of just using rememberSaveable?","acceptedAnswer":{"@type":"Answer","text":"ViewModels solve two Android-specific problems that rememberSaveable cannot fully address: surviving configuration changes and restoring state after process death via SavedStateHandle. rememberSaveable survives both but requires serialization logic that breaks down for complex objects, and unlike ViewModels it keeps state-updating logic tied to the UI, forcing slower, more brittle UI tests instead of fast local JVM unit tests. Developers weighing state management tradeoffs on Android can find deeper architecture discussions like this on daily.dev."}},{"@type":"Question","name":"What is the difference between the retain API in Jetpack Compose and using a ViewModel?","acceptedAnswer":{"@type":"Answer","text":"The retain API in Jetpack Compose survives configuration changes but not process death on its own, so it does not fully replace a ViewModel by default. Building a custom stateholder that mimics ViewModel behavior requires combining retain with a RetainObserver, a SaveableStateRegistry, and Navigation 3 NavEntryDecorators to scope the stateholder to a backstack entry and restore values after process death. Anyone evaluating whether to adopt newer Compose APIs over ViewModels can track these tradeoffs via daily.dev."}},{"@type":"Question","name":"What does Lifecycle version 2.11 change for ViewModels in Jetpack Compose?","acceptedAnswer":{"@type":"Answer","text":"Lifecycle 2.11 enables ViewModels to be scoped to individual composables rather than only to backstack entries, giving developers finer-grained control over ViewModel lifetime within Compose UI hierarchies. This builds on the existing ViewModel mechanisms for surviving configuration changes and process death through SavedStateHandle. Android developers adjusting scoping strategies after Lifecycle updates can follow related changes on daily.dev."}}]}
```

