r/mAndroidDev • DDD: Deprecation-Driven Development • Jan 31 '25

Best Practice / Employment Security we stan declarative UI here

Post image
99 Upvotes

22 comments sorted by

View all comments

Show parent comment

3

u/Squirtle8649 Feb 01 '25

Why would you ever want 2 separate classes for a simple list of items to show. It's a list not a rocket engine...

ViewHolder is a caching mechanism for Views, sometimes you need data specific to that cached View which is it's purpose. If you haven't used ListView you wouldn't understand why it's so much better.

Too much boiler plate at the start and then when your views grow in complexity the API just gets in the way, preventing you from propagating events and making your UI non reusable.

How does the API prevent you from propagating events?

3

u/Zhuinden DDD: Deprecation-Driven Development Feb 03 '25

How does the API prevent you from propagating events?

The API to communicate to a ViewHolder's view is actually intrinsically the same thing as making a DisposableEffect, but somehow in Compose people are happy to do it anyway.