issues
search
APDevTeam
/
Movecraft
The original movement plugin for Paper. Reloaded. Again.
GNU General Public License v3.0
123
stars
79
forks
source link
Use Dependency Injection for service initialization
#707
Open
oh-noey
opened
3 months ago
oh-noey
commented
3 months ago
Describe in detail what your pull request accomplishes
Use Dirk as a Dependency Injection (DI) framework to allow for simpler usage of the inversion of control pattern.
Adds several building block life cycle management systems to abstract away common patterns
Service
for startup/stop patterns
Worker
for an async/sync background processors
Simplifies event handler registration by automatically doing so once added to the DI container.
Abstract version management concepts via inversion of control
Dependents can use
VersionInfo
to access version related data
Abstract settings lifecycle management via a
Service
Eventually it would be good to migrate
Settings
to be injected, but that is out of scope for now
Migrate several small startup routines to
Service
singletons
Migrate all startup
BukkitRunnable
implementations to
Worker
TODO: Add unit test
Checklist
[ ] Unit tests
[ ] Proper internationalization
[ ] Tested
[ ] Performance tested
Describe in detail what your pull request accomplishes
Service
for startup/stop patternsWorker
for an async/sync background processorsVersionInfo
to access version related dataService
Settings
to be injected, but that is out of scope for nowService
singletonsBukkitRunnable
implementations toWorker
Checklist