Skip to content

Commit

Permalink
[INFO] Update README with architecture diagrams
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkrauz committed Feb 4, 2021
1 parent f719d6f commit 6eabce3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@ It is currently a work in progress being slowly improved weekend by weekend, for
Built 100% with Kotlin, it has a [single-activity](app/src/main/java/com/peterkrauz/grimoire/MainActivity.kt) and performs navigation actions
with Jetpack's Navigation Component. Fragments and [ViewModel](https://developer.android.com/topic/libraries/architecture/viewmodel)s interact with one another
through the usage of [LiveData](https://developer.android.com/topic/libraries/architecture/livedata)s, employing a unidirectional data flow on our presentation layer.
All (or at least the majority) of this project's [library dependencies](buildSrc/src/main/java) were declared using Gradle's Kotlin DSL.
All (or at least the majority) of this project's [library dependencies](buildSrc/src/main/java) were declared using Gradle's Kotlin DSL, which are located in a module (`:buildSrc`) of its own.
The focus is to display a modern multi-module design paired with a tidy architecture.


> ## Architecture
In search of achieving a [Clean Architecture](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html), the common monolithic Android structure
was dismembered into multiple modules.

> ### Module Dependencies
![dependencies](diagrams/module_dependencies.png)
I chose to have a separation by layer here. In doing so, `:domain` module will contain all UseCase classes of our app, no matter which presentation module it serves. Same goes for the `:data` module.
The only difference arises on the `:presentation` module, where each screen (and it's Fragments/States) were put into separate folders.<br>

> ### Layers
![layers](diagrams/architecture_layers.png)
Using this layout, our Domain layer (which encompasses both Application + Enterprise business rules) is completely unaware of any other module - as intended. The Data layer needs only to depend on the Domain to provide concrete implementations of the Domain's components (Repository, Entity, etc). <br>
The Presentation layer depends on both of the aforementioned layers, since it is the third layer of our architecture, and thus our state-handling Presenters must be able to dispatch and call for state-changing Interactors.
Finally, we have an "extra" layer - the App - that knows of everything else. There we have our app's entry-point, as well as the configuration and components of the chosen [Dependency Injection](https://java-design-patterns.com/patterns/dependency-injection/) library.


> ## Technologies
* [Coroutines](https://developer.android.com/kotlin/coroutines)
Expand Down
Binary file added diagrams/architecture_layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added diagrams/module_dependencies.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6eabce3

Please sign in to comment.