Instead, I was -in my previous company- using mainly implicits with a bunch of ugly Guice refection at the top layer (an artifact from the past more than a principled technological choice).
Having the chance to start a greenfield project recently, I decided to find an alternative to the solutions I did know about... as none of them were really satisfactory.
Talks is cheap, show me the code.Basically I use implicits until the application layer were I just have one layer of stacked trait... let's see it in action, in this gist we have:
- A basic trait to describe modules (set of components)
- A module with two components
- A component
- A Play! controller
- Integration with Play! dependency injection
- Integration with a main application
This approach seems to work great so far! Let me know if you give it a try.