View in the MVVM architecture
What is View in the MVVM architecture?
The View component in the MVVM architecture are the UI controllers – Activities and Fragments. They should be as free as possible from any business logic. Their role is to present the data, not to transform it. The view should contain only UI related logic. It is a common misconception to write all the logic for a particular screen in the corresponding Activity or Fragment. By doing so, we create God classes and we break the single responsibility principle. So we should always try to keep our View as clean as possible.
The View asks the ViewModel for data. The View doesn’t care where the data comes from, what kind of transformations are applied to it and so on. It only knows how to properly display the data on the screen. When the data is changed by user interactions with the UI components, the View calls the ViewModel’s methods and passes the changed data to them. Again, it is unaware of how the data is processed.

Letzte Beiträge
Share :
Share :
Weitere Beiträge

Using Room in CryptoOracle
In the Android application CryptoOracle the data is persisted in SQLite database. The reasons are two:
The application can still work and show persisted data when there is no internet connection.

Machine learning concepts. Network training and evaluation
The neural network model consists of two layers – an LSTM layer and an output Dense layer. The reason for choosing an LSTM layer is the need to process sequences of time-related data

6 Fragen an unseren Geschäftsführer Dimitar
Heute möchten wir euch Dimitar vorstellen, einen unserer zwei Geschäftsführer bei der DiSC. Er ist Spezialist für Mobile Netzwerke, Java Backend, Java Enterprise Edition sowie für Java Spring Boot