Android Architecture
Last modified: 07 March 2024Android Clean Architecture
Conclusion
tip
Clean architecture introduces a unique concept known as the domain layer.
It employs use cases to handle business logic independently.
The goal is to separate business logic from technology, minimizing the impact of > technological changes on the overall system.
Modularization
Conclusion
tip
In modularization, we apply clean architecture principles to demonstrate its functionality.
We partition UI, Domain, and data into a library or module, enabling reuse across multiple applications.
Model View ViewModel (MVVM)
MVVM Diagram 1
MVVM Diagram 2
Conclusion
tip
In MVVM, the ViewModel updates the View based on changes in the Model.
The ViewModel doesn't directly interact with the View; instead, it listens for > changes in the Model and updates the View accordingly.
Model View Intent (MVI)
MVI Diagram 1
MVI Diagram 2
MVI Diagram 3
Conclusion
tip
MVI expands on MVVM by introducing state management.
It enhances MVVM by placing a greater emphasis on understanding user intent and simplifying data retrieval through state reduction.
Choosing the Right Architecture
Selecting the appropriate architecture for your project is crucial and largely depends on factors such as project size and scalability goals.
There are various approaches to structuring your project, each with its own benefits and considerations.
Below, I outline my preferred approaches and considerations for selecting the appropriate architecture based on the project's size.
For Small projects
1st Approach
2nd Approach
3rd Approach
For Medium to Large projects
tip
Note: Not in particular order.
4th Approach
5th Approach
6th Approach
7th Approach
For Large to Enterprise projects
8th Approach
Reflection
Selecting the right architecture is a crucial decision that can significantly impact the success of your project. By considering factors such as project size, scalability, and specific requirements, you can choose an architecture that best fits your needs.
Whether it's modularization, clean architecture, MVVM, or MVI, each approach offers unique benefits and considerations. Remember to continuously evaluate and adapt your architecture as your project evolves to ensure scalability, maintainability, and overall success.