Giter Club home page Giter Club logo

Comments (5)

ChrisZou avatar ChrisZou commented on July 4, 2024

为什么呢?

from android-unit-testing-tutorial.

vipheyue avatar vipheyue commented on July 4, 2024

直接把AppComponent -> LoginActivity 还是不建议把全局的Component 直接给具体的 Activity.
容易误导其他来看这个项目的人

from android-unit-testing-tutorial.

ChrisZou avatar ChrisZou commented on July 4, 2024

“把全局的Component 直接给具体的 Activity”?不是很明白你的意思,能具体讲讲吗?
如果有误导人的地方,我很抱歉,不过目前还没明白是哪里有问题呢?

from android-unit-testing-tutorial.

vipheyue avatar vipheyue commented on July 4, 2024

你这个项目是测试 单独运行 没什么问题.
我看了一下代码. LoginActivity 需要的 对象或者数据 是通过 AppComponent 来注入的.
按照规范是因该通过 LoginComponent 来注入.
因为 如果LoginActivity需要更多的对象 我们因该在 LoginModule 里面提供..并使用 LoginComponent 来注入
而不是跑到AppComponent 里面去添加 LoginModule,这样会使得AppComponent变得非常的杂乱

from android-unit-testing-tutorial.

ChrisZou avatar ChrisZou commented on July 4, 2024

@vipheyue 谢谢你的反馈,明白你的意思了,你说的问题是关于deps太多、Module太大的情况下,怎么样划分多Module来合理的管理这些deps,这个是在熟悉dagger使用的前提下,再进一步的问题。而这篇文章的目标读者是不熟悉Dagger基本使用的人,希望能给一个基础的使用入门以及工作原理的介绍,并没有想过要一口气吃成大胖子,因此没有考虑太多其它并不是那么直接相关的问题。

from android-unit-testing-tutorial.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.