- The current state of the project is INCOMPLETE. The
appmodule only has a "preview" screen for "source" selection which isn't production ready code.
This demo app has the purpose of demonstrating knowledge over Android Development.
It is about to fetch social posts and display it to the user, but currently only integrates a single source: JSONPlaceholder
- The idea is to try to integrate a second source in a later stage to check how this architecture manages those changes.
Tried to follow a Clean Architecture as described by Robert C. Martin - Uncle Bob in his blog.
The project have different modules:
- domain contains the
use casesand the domainmodels, along with someinterfacesdefining therepositoryandexecutor. - data held
interfacesfor thedata store(interface for repository) anddata source(interface for the source of data). Also contains an implementation of thedata repositoryto be used in the above layers. - local
data sourceimplementation for a local source of data, storing usingRoom(which other modules should not be aware of) - remote
data sourceimplementation for the remote source of data, usingRetrofitto execute HTTP requests, this currently implements theJSONPlaceholdersource. - presentation responsible for managing the
stateof the views, contains theViewModelimplementations where will execute theuse casesfrom domain and manage thedata(to store, retrieve, etc.), signalling through thestateof theViewModelto the upper layers. - app consumer and "glue" of everything, will provide the DI required for each layer (using
Koin), it is a mobile representation ofUI(one of as many it could have - for example, another representation for TVs, another for Wearables, etc.). Here is the layer where the make the interaction with the user and manage it, through theViewModels, the state of the application storing/retrieving data when required.
The models was applied as much as possible the Clean Architecture way, where each module have their own model representation with the required mappers between them (the "exception" is app module where "reuse" the presentation's model)
It is understandable the approaches used here are an educational and "demoable" purpose, and in a real application some layers/representation can be "merged" together - as an example often implementation merges the app with the presentation.
Tried as much to use TDD as possible, I believe the coverage of the project is high, I did not generate the report, yet!
- TODO
Across some months I've been reading and checking loads of materials and references on architectures, patterns, etc. Usually, I check contents offered from the community and posted by users in:
- androiddevbr.slack.com
- android-united.slack.com
- kotlinlang.slack.com
But the main material used for this particular project was the course at caster.io offered by Joe Birch.
- I have a different style and approaches from what was practised in the course, where I applied in this project, for example, the
mappersare totally different approach, some abstractions and extensions were used, the DI library - wherein the course was usedDaggerI preferred to adventure inKoinwhere was new for me. For tests, I prefer the use ofMockK(more affinity and personal choice) than used in the courseMockito.
