https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
a

abbic

01/23/2023, 5:54 PM
hi all, starting my first desktop compose app. i come from the world of android so am used to MVVM and am thinking about using viewmodels as state holders here in a similar way. however, one of the main utilities of viewmodels on android is having a longer lifecycle than the view layer, which i dont think is an issue on desktop compose afaik. so am i going to be making things unnecessarily complicated for myself going forward in this fashion? does anyone have some recommendation of a ready made architecture pattern for me to organise my logic within this framework?
c

CLOVIS

01/23/2023, 7:48 PM
I've heard good things from #ballast
I've never really used anything like this and it's always felt fine. I just have immutable data classes for state, an interface that represents actions available for that state.
a

abbic

01/23/2023, 7:57 PM
thank you, ballast sounds good! it also sounds as though i can free-wheel it a bit but my preference is often towards opinionated frameworks as i find i can accomplish a great deal of wheel spinning if left to my own devices
f

frank

01/23/2023, 10:13 PM
I'm using Voyager (ViewModel) Framework, I think it can also be implement with Decompose .
a

Arkadii Ivanov

01/23/2023, 11:00 PM
Check out Decompose - it brings a "tree structure" architecture pattern, plus navigation with state restoration (if needed). https://github.com/arkivanov/Decompose
4 Views