-
Notifications
You must be signed in to change notification settings - Fork 36
Update method on Autofac builder is obsolete #64
Comments
Yes. The current design was based around the assumption that the containers could be modified after the initial registrations. This has also caused trouble with containers like SimpleInjector, which simply doesn't allow you to do this. We've been prototyping a bootstrapper design which doesn't have these assumptions. It collects all registrations up-front and relies on scoping and/or nested containers/lifetimes to provide request-scoped dependencies. Hopefully we'll be able to get that rolled into Nancy at some point in the future. |
As I've said before though, that prototype doesn't cover all the use cases we cover. There's a key difference between something being immutable, and its API not allowing you to "change" it. Strings are immutable in .net, but that doesn't ,mean you can't do "mystring = mystring + otherstring", it just returns a new string instance - this is exactly how I'd expect containers to work that require internal immutability for performance. |
@grumpydev Are you trying to say that we can't cover these use cases by having an immutable container? |
I'll commit to work with you on this asap if you're up for it :P |
Yes! New year, new bootstrapper 😁 |
Is this project dead? Did nancy-bootstrapper-prototype get parked? Edit: In the meantime here's a hack to allow moderately painless usage of the code from this repo with autfoac 4.9.x Warning this has had all of 5 minutes testing
|
Autofac documentation says:
http://docs.autofac.org/en/latest/best-practices/index.html#consider-a-container-as-immutable
And they make Update obsolete:
This leads to major modifications in this bootstrapper.
The text was updated successfully, but these errors were encountered: