Clean Architecture is a much-discussed topic in recent years not only in the Android community. You can find many articles about it and most of them are devoted to an explanation and implementation of the Dependency Rule, which is the basis of the Clean Architecture. Implementing the Dependency Rule is quite easy but it is also really easy to violate it and it can be really hard to uncover that on the code review. It would be possible to control it better using `package private` visibility or divide app layers properly to separate modules. The problem is that we do not have `package private` visibility in Kotlin and layer modularization does not have to be a good or preferred architecture for our app. But don’t worry! We can use help from the static code analysis tool called detekt and I am going to show you how in this article. I expect that you already know and understand Clean Architecture including the Dependency Rule. If you don’t, I recommend this great article from Mario Sanoguera de Lorenzo. (more…)
Are you interested in our work? We publish posts that keep readers up to date with the technologies we utilize, as well as what we’ve found to be good and bad for use. We believe that promoting maximal transparency is vital to both our clients as well as others in the tech community.