The AbstractModule class

To improve things, there is an abstract class called AbstractModule, which straightforwardly extends the module interface, so applications can rely upon AbstractModule as opposed to module.

It's strongly suggested that modules should be extended to the usage of AbstractModule. It gives a more readable configuration, and additionally steers us away from the excessive invoking of methods on the binder.

In our example ApplicationModule, to configure Guice instead of implementing the module interface, we have used AbstractModule, where Guice passes our module to the binder interface.

In the event that an application has a predetermined number of configurations, they could be consolidated in a solitary module. For such ...

Get Java 9 Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.