Does your application suffer from a monolithic architecture that makes it hard for you to maintain, extend and test? Do multiple responsibilities plague your classes? Is your codebase tightly coupled to specific frameworks, databases and other third-party dependencies? Are your business rules riddled with information from multiple sources? If so, then the principles of Clean Architecture will help to get your codebase under control and in a more manageable state.
Clean Architecture allows us to create systems whos responsibilities are clearly defined and separated. Firstly this makes our projects easier to read and navigate due to the strict responsibility of our layers and classes. Secondly, this makes it easier to extend on the current functionality due to the lightweight classes and responsibilities that we previously created. And finally, all of this makes it far easier to test the different classes and responsibilities of our system - as well as allowing us to keep these tests small and focused also.
Throughout this process, we'll be using a range of technologies and libraries to create our project, this includes:
- Kotlin as our language to code in
- Lifecycle Architecture Components for our View Model classes
- The Room Architecture Component for local data persistence
- Retrofit for our network request
- RxJava to handle the orchestration and execution of data operations
- Dagger 2 for Dependency Injection
- Design support library for our UI components
- Espresso for our Android UI tests
- Mockito for handling mock data in our tests
With all this together, we'll be developing a modularised Android Application using the Clean Architecture principles to allow us to benefit from all of these things. Layer by layer, we'll build up an application that will allow you to greatly clean-up the current state of your architecture.