diffix / explorer

Tool to automatically explore and generate stats on data anonymized using Diffix
MIT License
2 stars 1 forks source link

Remove duplicate component invocations #239

Closed dandanlen closed 4 years ago

dandanlen commented 4 years ago

Fixes #236

There were actually two problems causing this:

  1. Some ExplorerComponent implementations took other concrete implementations as constructor arguments. This caused the dependency injector to resolve these anew upon every invocation with a transient lifetime. We should always use interfaces (ie. ResultProvider<T>) in the constructor arguments for components to ensure the DI works as expected.
  2. Wherever classes implemented two component interfaces, ResultProvider<T> and PublisherComponent, the DI treated these as separate invocations (despite the scoped lifetime) so there could be two (but no more 😅 ) of each of these components. Fixing this required some reflection magic during component registration to 'forward' the second registration to the first.
dandanlen commented 4 years ago

Rebased and force-pushed to refresh travis status...