-
Notifications
You must be signed in to change notification settings - Fork 1
OptionalAOP
Building Guice without AOP support
Guice 1.0 was available in a single version that included AOP.
In Guice 2.0 and later, AOP is optional. If your platform doesn't support bytecode generation, you can download a version of Guice that doesn't include AOP support. This is most useful for mobile platforms like Android. This version also lacks fast reflection and line numbers in error messages. For this reason, we recommend Guice+AOP even in applications that don't use method interceptors.
Guice 1.0 | Guice 2.0 no AOP | Guice 2.0 | GIN | |
---|---|---|---|---|
Library size | 544KB | 430KB | 652KB | 0KB (code gen) |
High performance | ✔ | ✔ | ✔ | ✔ |
Binding EDSL | ✔ | ✔ | ✔ | ✔ |
Scopes | ✔ | ✔ | ✔ | ✔ |
Typesafe | ✔ | ✔ | ✔ | ✔ |
Fast reflection | ✔ (cglib) | ✔ (cglib) | ✔ (code gen) | |
Line numbers in error messages | ✔ | ✔ | ||
Method interceptors | ✔ | ✔ | ||
Provider Methods | ✔ | ✔ | ✔ | |
Binding overrides | ✔ | ✔ | ||
Tool-friendly SPI | ✔ | ✔ | ||
Child Injectors | ✔ | ✔ | ||
Servlet Support | Scopes Only | ✔ | ✔ | |
Error Reporting | Good | Better | Best | Best |
Guice has an ant task that creates a modified copy of the Guice source-tree. The copy uses the munge preprocessor to remove all bytecode-dependent APIs. Use the following commands to build Guice without AOP support:
ant no_aop
cd build/no_aop/
ant dist
Building with Maven automatically generates a no_aop artifact.
- User's Guide
- Best Practices
- Frequently Asked Questions
- Integration
- Extensions
- Internals
- Releases
- Community