Let's see a brief explanation about these terms in a nutshell.
- Android-Activity is independent, it can present the view itself.
- Android-Fragment can't run independently and requires an Android-activity as its host, which means that when the Android-activity is/was destroyed then the Android-fragment will be too. The Android-fragment does not strictly specify which Android-activity should or can host it, as long as it is an Android-activity then you're good.
- Both Android-activity and Android-fragment can have ViewModel.
- ViewModel is always dependent on Android-activity or Android-fragment lifecycle, which means that when the Android-activity/ Android-fragment is/was destroyed then the ViewModel will be destroyed as well (except for configuration changes).
Let's see some relationships defined in the UML class diagram.
- Composition (not sure, since the Android-activity doesn't depend on the Android-fragment)
- Aggregation (not sure, since the Android-fragment will be destroyed if the Android-activity destroyed the same with the ViewModel, where aggregation encourage that both parties can live with its own)
- Association (maybe yes or no?)
- Dependency (maybe yes or no?)
Generalization (definitely no)Realization (definitely no)
Now, to model them on UML Class Diagram, there are some questions:
- What is the relationship between the Android-activity and the Android-fragment?
- What is the relationship between the Android-activity/ Android-fragment and ViewModel?

