FHIR
FHIR copied to clipboard
Use injectable services instead of singletons
Is your feature request related to a problem? Please describe. Services like FHIRRemoteIndexService currently are accessed using a static instance. The service is initialized in FHIRServletContextListener.
Describe the solution you'd like We should use a whiteboard pattern where services can be published rather than rely on a static instance variable. This reduces coupling and in general makes it easier to test (by making it easier to inject mocks etc).
Describe alternatives you've considered Keep the current pattern.
Acceptance Criteria
- GIVEN the refactor is implemented WHEN the code is built and the system integration tests are executed THEN the build succeeds and the system integration tests all pass.
Additional context N/A
this sounds a lot like https://github.com/IBM/FHIR/issues/2687