Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite dependency injection to use Dagger #214

Merged
merged 26 commits into from Dec 29, 2019
Merged

Rewrite dependency injection to use Dagger #214

merged 26 commits into from Dec 29, 2019

Conversation

@msfjarvis
Copy link
Owner

msfjarvis commented Dec 28, 2019

No description provided.

@pr-triage pr-triage bot added the PR: unreviewed label Dec 28, 2019
msfjarvis added 4 commits Dec 18, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Fixed with v2.25 according to https://medium.com/androiddevelopers/dagger-in-kotlin-gotchas-and-optimizations-7446d8dfd7dc

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis force-pushed the refactor/dagger branch from f9f4db3 to 8d297f5 Dec 28, 2019
msfjarvis added 12 commits Dec 28, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis force-pushed the refactor/dagger branch from fc37753 to b08f384 Dec 29, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis force-pushed the refactor/dagger branch from b494df0 to e23f878 Dec 29, 2019
msfjarvis added 4 commits Dec 29, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis force-pushed the refactor/dagger branch from e8365dd to 9d576ea Dec 29, 2019
msfjarvis added 3 commits Dec 29, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis force-pushed the refactor/dagger branch from 9d947be to fc54ec6 Dec 29, 2019
msfjarvis added 2 commits Dec 29, 2019
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
@msfjarvis msfjarvis changed the title I was bullied Rewrite dependency injection to use Dagger Dec 29, 2019
@msfjarvis

This comment has been minimized.

Copy link
Owner Author

msfjarvis commented Dec 29, 2019

Takeaways from this effort:

  • Dagger is ridiculously complex without a human to guide you around.
  • Koin's service locator pattern makes it far too easy to write bad code because you can inject anything anywhere.
  • Dagger can feel like a lot of boilerplate but some clever techniques can mitigate that.
  • Writing inject methods for every single class can feel like a drag because it is.
  • Injecting into Kotlin objects appears to be a no-go. I opted to refactor out the staticity where possible, pass injected dependencies to the function or fall back to 'dirty' patterns as needed. Do what you feel like.
  • I still do not love Dagger. Fuck you Google.
@msfjarvis msfjarvis merged commit 4380ded into master Dec 29, 2019
6 checks passed
6 checks passed
unit-testing
Details
greeting
Details
CodeFactor 6 issues fixed. 5 issues found.
Details
WIP Ready for review
Details
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/push Build is passing
Details
@msfjarvis msfjarvis deleted the refactor/dagger branch Dec 29, 2019
@pr-triage pr-triage bot added PR: merged and removed PR: unreviewed labels Dec 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.