playframework/playframework — pull request #3442 by gmethvin (2014-09-25 07:28:35+00:00)
Title: Allow modules to be specified explicitly in code instead of play.modules file

I think the extra level of indirection of having the `play.modules` file is not particularly useful, and might end up confusing some users. I would much rather add modules by doing something like this:

```scala
class MyApplicationLoader extends GuiceApplicationLoader {
override lazy val additionalModules = Seq(new ModuleA, new ModuleB, ...)
}
```

This is extremely clear, type safe, and makes it obvious to users what is loading the application (the `ApplicationLoader`), so they can easily inspect its documentation and customize it more in the future.

The other problem with loading `play.modules` files is that other third-party libraries could define a file with modules that end up binding the same things as the user's modules. This creates conflicting bindings that are unclear to users, as the mechanism of loading modules is hidden from them.

This is also related to #3370.

I'm happy to work on this but I wanted to make sure everyone agreed with the reasoning first.