Consider Dagger 2 vs Guice #31

Closed
opened 4 years ago by gpe · 1 comments
gpe commented 4 years ago
Owner

kapt isn't supported by JBS yet (and they don't have any plans to add support), which makes using Dagger 2 without delegating the build to Gradle/Maven annoying. I don't want to delegate the build if possible, as JBS is faster and uses less memory.

Guice will work fine as it's reflection based, but it will be slower. A very important goal is a fast startup time, even on low-end computers, as it makes the development/test cycle easier.

kapt isn't supported by JBS yet (and they don't have any plans to add support), which makes using Dagger 2 without delegating the build to Gradle/Maven annoying. I don't want to delegate the build if possible, as JBS is faster and uses less memory. Guice will work fine as it's reflection based, but it will be slower. A very important goal is a fast startup time, even on low-end computers, as it makes the development/test cycle easier.
Poster
Owner

I think I'm going to go with Guice for the moment. If it does turn out to be too slow, switching to Dagger shouldn't be too bad (as they both use the standard injection annotations).

I don't plan to use classpath scanning or anything too fancy - I think classpath scanning is what made one of my previous projects fairly slow.

It's worth pointing out that during the development/testing cycle no time is probably saved, as you need to run the Dagger annotation processor every time before starting the server anyway.

I think I'm going to go with Guice for the moment. If it does turn out to be too slow, switching to Dagger shouldn't be too bad (as they both use the standard injection annotations). I don't plan to use classpath scanning or anything too fancy - I think classpath scanning is what made one of my previous projects fairly slow. It's worth pointing out that during the development/testing cycle no time is probably saved, as you need to run the Dagger annotation processor every time before starting the server anyway.
gpe closed this issue 4 years ago
Sign in to join this conversation.
Loading…
There is no content yet.