Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should dependency injection be used here? #5

Open
git4sun opened this issue Nov 15, 2016 · 1 comment
Open

Should dependency injection be used here? #5

git4sun opened this issue Nov 15, 2016 · 1 comment

Comments

@git4sun
Copy link

git4sun commented Nov 15, 2016

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
Copy link
Contributor

Added this in #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants