什么是好建筑方面使用DI(匕首)的好榜样? [英] What is the good example of using DI (Dagger) in terms of good architecture?

查看:181
本文介绍了什么是好建筑方面使用DI(匕首)的好榜样?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的Andr​​oid应用程序创建模块化的架构,现在我寻找到匕首DI库。这真是真棒的工具,但我不想滥用它,目前我有许多问题,如:

I'm trying to create modular architecture for my Android app and now I'm looking into Dagger DI library. It's really awesome tool, but I don't want to misuse it and currently I have numerous questions like:


  • 我应该换行的一切(如活动或片段,或事件单独查看)为模块或应用的只有常用的部分(喜欢与登录,数据层的数据查询服务)?

  • 与Android注释更好地利用。 Android的注解是我面临的另一个很酷的库,但它似乎与UI层制作容易伊林与视图,片段和删除一些样板code发挥出色。但是,如何合乎理它匕首玩?

如果您在使用DI请参考我的开源项目的一个很好的例子。我真的要遵循最佳实践。

If you have a good example of open source project using DI please refer to me. I really want to follow best practices.

推荐答案

在看看:

  • Jake Wharton's u2020 app;
  • u2020-mortar - port of Jake Wharton's u2020 app with use of Mortar & Flow;
  • u2020-mvp - another port by Live Typing with MVP pattern in mind.

这篇关于什么是好建筑方面使用DI(匕首)的好榜样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆