MVVM
Question
MVVM- what it is (layers) and how to use it in native project (popular frameworks - bindings, converters etc.).
Short interview answer
Model-View-ViewModel (MVVM) separates UI state and presentation behavior from the view. The view binds to a view model; the model represents domain or data concerns. In a native app, the same separation can be implemented with platform-specific binding or observation mechanisms.
Detailed answer
The view model exposes display-ready state and commands, while the view renders it and forwards user actions. For a login screen, the view model can expose Email, Password, validation state, and a sign-in command; the platform view handles layout and native control behavior. Value converters can translate a view-model value into a display-specific value, but business rules should remain in the model or view model. MVVM is a structure, not a requirement to use a particular framework: avoid placing navigation, lifecycle, or platform APIs into a supposedly portable view model when they are truly platform concerns.
Glossary
- MVVM: Model-View-ViewModel.