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

Add support for providing configuration to player persistence implementations #412

Open
garyttierney opened this issue Aug 23, 2018 · 1 comment
Labels
low priority Requires no immediate fix needs-discussion The project maintainers request input from users

Comments

@garyttierney
Copy link
Contributor

The current implementation of player loading/saving in Apollo relies on the persistence providers having a no-args constructor, making implementation of persistence providers that rely on external systems troublesome.

For example, a persistence provider that uses a JDBC connection to load data from a SQL database will likely want to pool its connections. To achieve this the implementation would need to share the pool via static state, which makes testing difficult and the code obtuse.

Solutions:

  • Bootstrap the server using a fully-fledged Dependency Injection framework (Guice?)
  • Extend the PlayerLoader XML reader with support for passing in configuration parameters/other objects.
@garyttierney garyttierney added low priority Requires no immediate fix needs-discussion The project maintainers request input from users labels Aug 23, 2018
@Arham4
Copy link
Contributor

Arham4 commented Dec 2, 2018

I would argue for Dagger 2 over Guice. Compiler auto-generated code (Dagger) will prevail for me over reflections during run-time (Guice), but I probably have a bias because I used jOOQ for SQL querying and loved auto-generated code because of it. I like having compiler-enforced behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Requires no immediate fix needs-discussion The project maintainers request input from users
Projects
None yet
Development

No branches or pull requests

2 participants