This was created as part of effort to get more familiar with developing Android apps using
Kotlin and the new Android Architecture Components,
and also to explore use of the increasingly popular Clean Architecture approach. It's heavily based on https://github.com/bufferapp/clean-architecture-components-boilerplate.
This is stil work in progress and also, at least for now,
have omitted formal Mapper
classes (though some data model translation does occur between the layers).
As I'm pretty new to Kotlin and some of the libraries used I'm sure there are better ways of implementing some of the code I have so feedback (and PRs!) are very welcome. I also continue to incorporate changes based on articles and other repos I come across.
Note also that this is using REST endpoint provided by @appsandwich to retrieve Galway Bus route/timetable info (Thanks Vinny!)
For an app of this size and complexity it can be argued that full use
of Clean Architecture abstractions is overkill....at least right now method implementations
in many of the layers simply delegate to corresponding method in layer below (though
starting to see a few exceptions to that).
A reasonable approach for an app like this might be, for example, to have ViewModel
implementations interact directly with the Repository
. In either case,
a key important benefit of this architecture is that code below the UI layer should not have
any dependencies on Android framework and can be easily unit tested.
More recently I've also been using this project to explore some of the relatively new Kotlin Multiplatform
capabilities. There is now kotlin-multiplatform ShareCode
module for example and some sample iOS apps in ios
folder. Have also
written a couple of post about some of my experiences doing this so far