Skip to content

Commit

Permalink
Merge pull request #47 from mgreene/master
Browse files Browse the repository at this point in the history
Add docs for upgrading from dropwizard-guice
  • Loading branch information
jhaber authored Aug 16, 2019
2 parents 4f961cc + e193eca commit a01905c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,11 @@ binding, [for example](https://github.com/jhaber/dropwizard-guicier-example/blob
There is an [example project](https://github.com/jhaber/dropwizard-guicier-example) you can clone and play with if you'd like to get
going right away.

Enjoy!
## Upgrading from dropwizard-guice
There are a couple important changes to be aware of when upgrading from [dropwizard-guice](https://github.com/HubSpot/dropwizard-guice).

### AutoConfig has been removed
Reasoning and potential workarounds are discussed [here](https://github.com/HubSpot/dropwizard-guicier/issues/41) (fwiw we've ditched AutoConfig internally and have never looked back).

### Explicit Bindings Required
By default, dropwizard-guicier installs a [module](https://github.com/mgreene/dropwizard-guicier/blob/278056ff871116db844126a41711155d91900011/src/main/java/com/hubspot/dropwizard/guicier/GuiceBundle.java#L135-L143) which makes Guice run in a more strict mode. In particular, just-in-time bindings are disabled and all objects must be explicitly bound. In addition, it requires that no-arg constructors are annotated with `@Inject` for Guice to use them. You can opt out of having this module installed by calling `enableGuiceEnforcer(false)` when constructing your `GuiceBundle`.

0 comments on commit a01905c

Please sign in to comment.