Skip to content

Instantly share code, notes, and snippets.

View CarlitosDroid's full-sized avatar
🎯
Focusing

Carlos Leonardo Camilo CarlitosDroid

🎯
Focusing
  • Lima, Perú
View GitHub Profile
@CarlitosDroid
CarlitosDroid / CleanArchitecture.md
Created February 23, 2021 05:44 — forked from ygrenzinger/CleanArchitecture.md
Summary of Clean Architecture by Robert C. Martin

Summary of book "Clean Architecture" by Robert C. Martin

Uncle Bob, the well known author of Clean Code, is coming back to us with a new book called Clean Architecture which wants to take a larger view on how to create software.

Even if Clean Code is one of the major book around OOP and code design (mainly by presenting the SOLID principles), I was not totally impressed by the book.

Clean Architecture leaves me with the same feeling, even if it's pushing the development world to do better, has some good stories and present robust principles to build software.

The book is build around 34 chapters organised in chapters.

@CarlitosDroid
CarlitosDroid / UserComponent.kt
Created March 30, 2019 04:34
The UserComponent in the User Dynamic Feature Module
@Component(modules = [UserModule::class], dependencies = [CoreComponent::class])
interface UserComponent : BaseComponent<UserActivity> {
@Component.Builder
interface Builder {
fun build(): UserComponent
fun coreComponent(component: CoreComponent): Builder
fun userModule(component: UserModule): Builder
fun sharePreferencesModule(module: SharedPreferencesModule): Builder
}
@CarlitosDroid
CarlitosDroid / MainComponent.kt
Created March 30, 2019 04:31
The main component
@Component(modules = [MainModule::class], dependencies = [CoreComponent::class])
interface MainComponent : BaseComponent<MainActivity> {
@Component.Builder
interface Builder {
fun build(): MainComponent
fun coreComponent(module: CoreComponent): Builder
fun coreGsonModule(module: CoreGsonModule): Builder
fun coreOkHttpModule(module: CoreOkHttpModule): Builder
@CarlitosDroid
CarlitosDroid / CoreComponent.kt
Created March 30, 2019 04:03
The Dagger Core Component in the Core Module(Android Library)
@Component(
modules = [
CoreGsonModule::class,
CoreOkHttpModule::class,
SharedPreferencesModule::class,
UserDataModule::class]
)
interface CoreComponent {
@Component.Builder
@CarlitosDroid
CarlitosDroid / user-build.gradle
Created March 30, 2019 03:25
Dynamic features knows that the app module exits, but this doesn't happen in the opposite direction.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':app')
kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
}
@CarlitosDroid
CarlitosDroid / app-build.gradle
Created March 30, 2019 03:07
App module using Core Module (Android Library)
dependencies {
api project(':core')
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
kapt "com.google.dagger:dagger-compiler:${versions.dagger}"
}
@CarlitosDroid
CarlitosDroid / core-build.gradle
Created March 30, 2019 02:58
Core dependencies in Core Module
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api "com.squareup.okhttp3:okhttp:${versions.okhttp}"
api "com.squareup.okhttp3:logging-interceptor:${versions.okhttp}"
api 'androidx.appcompat:appcompat:1.0.2'
api "androidx.constraintlayout:constraintlayout:${versions.constraintLayout}"
api "androidx.lifecycle:lifecycle-extensions:${versions.lifecycle}"
api "com.google.code.gson:gson:${versions.gson}"