outworkers / phantom-activator-template

[DEPRECATED] Typesafe Activator seed with Phantom and Play! Framework.
Other
40 stars 12 forks source link

Should dependency injection be used here? #5

Open git4sun opened 7 years ago

git4sun commented 7 years ago

I implemented a play 2.5 app with phantom a few months ago with very similar approach of this project. When going to production, I realized that I have to maintain a separate configuration file to specify the clusters and keyspaces. So I created a service with a trait and a Singleton class with play Configuration injection, and then initialize the contactpoint with settings from play configuration files. Then controllers can inject the service when needed. However, the service code is kind of ugly since extends AppDatabase(Defaults.Connector) cannot be done in a class. Is there an elegant way of doing this?

wsargent commented 7 years ago

Added this in https://github.com/outworkers/phantom-activator-template/pull/9