Benefits of Good Architecture
Seperation of Concerns Design Principle
- The code is more organized and manageable and debuggable
- We don't have to worry about lifecycle problems and bugs.
- The code is very modular, and unidirectional i.e. UI Controller knows about the ViewModel but the ViewModel doesn't know about the UI Controller.
One of the goal of this architecture is to keep the number of references between classes small, this modularity allows us to swap out single calls for a different implementation, without needing to update a bunch of other classes in your app.
For example, you can redesign the UI but you don't need to make changes to the ViewModel.
Another benefits of ViewModel is that it doesn't contain references to activities, fragments or views. This happens to be helpful for testing.
Comments
Post a Comment