https://kotlinlang.org logo
#android-architecture
Title
# android-architecture
d

Danil Novoselov

10/08/2019, 6:09 AM
Hi there! Is it okay to have one
GeneralViewModel
, that contains another one (or two no matter)
Specific1ViewModel
? Setting as field we can provide the
Specific1ViewModel
to
GeneralViewModel
r

rkeazor

10/08/2019, 12:32 PM
No. Just have individual Viewmodels
d

dewildte

10/08/2019, 2:57 PM
The S in SOLID is your friend here. And if your having trouble understanding where to assign responsibilities then I also suggest learning GRASP. But in short No, do not nest `ViewModel`s in `ViewModel`s.
d

Danil Novoselov

10/09/2019, 6:32 AM
Thanks a lot! I’ll take it into account!
2 Views