[FR]: Re assess the dependencies in the multi module setup

Open
#2,103 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
kotlin
Domain
build-system

Research direction

Start with the core:data build file and review the dependencies currently declared as api, along with how the feature module accesses network types. Compare that dependency visibility with the proposed implementation declarations; done means reaching and documenting a decision about the intended module boundaries and updating the declarations if that decision is accepted.

Written by the indexing model from the issue text.

Description

enhancement
Is there an existing issue for this?
  • I have searched the existing issues
Describe the problem
Image

Look at the picture above. I am able to access stuff from the network module right in the feature module . This in my opinion is a breach of engineering practices where in the scope of a component should only be limited to what it needs .

Perhaps we should address the dependencies mentioned as "apis" in core:data build file , and look into making them "implementation" ?

This decision of making use of apis in core:data has been done intentionally though , but can you please present an argument against what i have suggested ?

Describe the solution
dependencies {
    implementation(projects.core.common)
    implementation(projects.core.database)
    implementation(projects.core.datastore)
    implementation(projects.core.network)

    implementation(projects.core.analytics)
    implementation(projects.core.notifications)

    testImplementation(libs.kotlinx.coroutines.test)
    testImplementation(libs.kotlinx.serialization.json)
    testImplementation(projects.core.datastoreTest)
    testImplementation(projects.core.testing)
}

In my opinion this is how the core:data should look like

Additional context
Image
Code of Conduct
  • I agree to follow this project's Code of Conduct
Dominant language
Kotlin
Stars
22.1k
Forks
4.7k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from android/nowinandroid

All issues in android/nowinandroid

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.