wolverine icon indicating copy to clipboard operation
wolverine copied to clipboard

Investigate decoupling Wolverine from Lamar

Open jeremydmiller opened this issue 1 year ago • 1 comments

  • Would depend on making assumptions about other container behavior. Might use Lamar strictly to "plan" using the otherwise built in ServiceCollection

jeremydmiller avatar Feb 15 '24 14:02 jeremydmiller

Honestly, right now this looks like the limitation might be "Lamar or the built in DI container". To use other containers, we'll need to possibly force Wolverine into a "stupid, service locator all the things" mode. I'm unenthusiastic. I'd rather have Wolverine be good with a limitation on IoC container choice than be possible to be mediocre with whatever else is out there.

jeremydmiller avatar Apr 26 '24 14:04 jeremydmiller

I would support a global setting in Wolverine to enforce DI (and basically make Lamar obsolete in this case).

The result of enabling setting XY globally would be

  • Always create a nested container / scope per Message
  • Always create a nested container / scope per HTTP request
  • Resolve all dependencies from DI container (besides the things like IMessageContext)

Whether Lamar is still required then doesn't really matter to me. But having a guaranteed strategy on how dependencies are resolved is important to me.

Xzelsius avatar May 14 '24 15:05 Xzelsius

@Xzelsius I take pull requests.

I'm deeply unenthusiastic. I get that you've got the awkward EF Core thing to contend with, but I'm not willing to disable Wolverine this way.

jeremydmiller avatar May 15 '24 18:05 jeremydmiller

This is complete in the 3.0 branch

jeremydmiller avatar Jul 08 '24 10:07 jeremydmiller