What is the difference between Dagger and Dagger 2.0?

跟風遠走 提交于 2019-12-07 11:10:33

问题


What is the difference between Dagger and Dagger 2.0, and why did Google decide to fork the existing project?


回答1:


Some quotes from the Dagger 2 presentation

Issues of Dagger 1:

  • Ugly generated code
  • Runtime graph composition
  • Inefficient graph creation
  • Partial traceability
  • Map-like API

Dagger 2 solutions:

  • Compile-time validation of the entire graph
  • Easy debugging; entirely concrete call stack for provision and creation
  • Fully traceable
  • POJO API
  • Performance

Dagger 2 issues:

  • Less flexible
  • No dynamism
  • No automated migration path from Guice


来源:https://stackoverflow.com/questions/27888580/what-is-the-difference-between-dagger-and-dagger-2-0

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!