3 ms·
Standardized dependency injection is great news! The Play application I work on has a home-grown dependency injection system that leaves a lot to be desired. It
by benburton 11y ago
Standardized dependency injection is great news! The Play application I work on has a home-grown dependency injection system that leaves a lot to be desired. It will be great to see a more standard way of doing this.
- kodablah 11y agoI have seen many projects use scala-guice [1][2]. If all I have to do is build a module [3] and @Inject[4] in to the top of my controller, I struggle to see the benefits of Play supporting it directly. 1 - https://github.com/codingwell/scala-guice https://github.com/codingwell/scala-guice 2 - https://github.com/mohiva/play-silhouette-seed https://github.com/mohiva/play-silhouette-seed 3 - https://github.com/mohiva/play-silhouette-seed/blob/master/app/modules/SilhouetteModule.scala https://github.com/mohiva/play-silhouette-seed/blob/master/a... 4 - https://github.com/mohiva/play-silhouette-seed/blob/master/app/controllers/ApplicationController.scala https://github.com/mohiva/play-silhouette-seed/blob/master/a...
- benmccann 11y agoThe big difference with 2.4 is that Play now uses DI internally. So if you want to replace some Play component with your own version of that component, you can do that. With 2.3 you could use DI with your own app, but couldn't with any Play-provided components.