@@ -83,8 +83,7 @@ <h2 id="kapt-anger"><code>kapt</code>: anger</h2>
8383especially if you are running tests more often than the project executable itself.
8484I’ve asked myself a million dollar question.</ p >
8585< blockquote >
86- < p > Do you even need < code > kapt</ code > ?</ p >
87- </ blockquote >
86+ < p > Do you even need < code > kapt</ code > ?</ p > </ blockquote >
8887< p > Turns out there was only a single annotation-processing dependency in the project.
8988I think you already know which one. Yep, it was < a href ="https://google.github.io/dagger/ "> Dagger</ a > .
9089Down the rabbit hole we go.</ p >
@@ -106,8 +105,7 @@ <h2 id="do-you-even-need-kapt-dagger">Do You Even Need <del><code>kapt</code></d
106105< a href ="https://golang.org/pkg/context/ "> Go</ a > and
107106< a href ="https://spring.io/understanding/application-context "> Spring</ a > .
108107You can associate it with Google Dagger < code > @Component</ code > or
109- a Square Dagger < code > ObjectGraph</ code > .</ p >
110- </ blockquote >
108+ a Square Dagger < code > ObjectGraph</ code > .</ p > </ blockquote >
111109< p > There is a downside though. The Square version had a small but extensive API.
112110In my opinion, it covered almost everything you need from a dependency injection.
113111The Google version has grown up big and sometimes not in a good way.
@@ -181,16 +179,14 @@ <h2 id="do-you-even-need-kapt-dagger">Do You Even Need <del><code>kapt</code></d
181179< h2 id ="decisions-decisions "> Decisions, Decisions</ h2 >
182180< p > All of the above got me thinking.</ p >
183181< blockquote >
184- < p > Do you need complex tools to solve simple problems?</ p >
185- </ blockquote >
182+ < p > Do you need complex tools to solve simple problems?</ p > </ blockquote >
186183< p > As you can see, the setup is pretty simple.
187184Yes, < em > potentially</ em > Dagger could give some benefits,
188185but is it worth it increasing build time for every developer on the team
189186dozens of times per day? And taking into an account the fact
190187that this setup worked for years without any change at all?</ p >
191188< blockquote >
192- < p > Do you need to keep using tools designed for different conditions?</ p >
193- </ blockquote >
189+ < p > Do you need to keep using tools designed for different conditions?</ p > </ blockquote >
194190< p > Let’s face it — the annotation processing is a nice idea but meant
195191for special environments.
196192It is too verbose to declare everything by hand using Java, so here we go,
@@ -199,8 +195,7 @@ <h2 id="decisions-decisions">Decisions, Decisions</h2>
199195I have no idea, it is your codebase and your call. I did mine.</ p >
200196< h2 id ="back-to-the-roots "> Back to the Roots</ h2 >
201197< blockquote >
202- < p > Having a library isn’t cool. You know what’s cool? Not having a library.</ p >
203- </ blockquote >
198+ < p > Having a library isn’t cool. You know what’s cool? Not having a library.</ p > </ blockquote >
204199< p > Let’s go crazy and use Kotlin to make our own
205200< a href ="https://en.wikipedia.org/wiki/Inversion_of_control "> inversion of control</ a > implementation.
206201Not < a href ="https://github.com/Ekito/koin "> Koin</ a > ,
@@ -211,8 +206,7 @@ <h2 id="back-to-the-roots">Back to the Roots</h2>
211206< p > I highly suggest reading
212207< a href ="https://martinfowler.com/articles/injection.html "> a Martin Fowler article</ a >
213208about inversion of control (IoC) containers.
214- It contains almost everything you need to know about IoC, so I’m going to talk about practice only.</ p >
215- </ blockquote >
209+ It contains almost everything you need to know about IoC, so I’m going to talk about practice only.</ p > </ blockquote >
216210< h3 id ="modules "> Modules</ h3 >
217211< p > What is a module? It is a registry of dependencies.
218212What properties a module has? Dependencies on other modules.
@@ -426,7 +420,7 @@ <h1 id="fin">Fin</h1>
426420pick it based on your needs and do not adapt your needs to a tool.
427421We develop things to solve issues, not to create them.</ p >
428422< hr >
429- < p > PS Bonus points to everyone who got < a href ="https://en.wikipedia.org/wiki/A_Flight_to_Remember "> the Futurama reference</ a > 😉 </ p >
423+ < p > PS Bonus points to everyone who got < a href ="https://en.wikipedia.org/wiki/A_Flight_to_Remember "> the Futurama reference</ a > 😉 </ p >
430424< hr >
431425< p > Thanks to < a href ="https://twitter.com/artem_zin "> Artem Zinnatullin</ a > and
432426< a href ="https://twitter.com/PreusslerBerlin "> Danny Preussler</ a > for the review!</ p >
0 commit comments