Movecraft icon indicating copy to clipboard operation
Movecraft copied to clipboard

Use Dependency Injection for service initialization

Open oh-noey opened this issue 1 year ago • 0 comments

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

oh-noey avatar Sep 01 '24 06:09 oh-noey