<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>But this is a cross thread relationship, right? The scoping in this case is transversal to lexical scoping or thread scoping. A bean that is bound to some sub-context of the application context, is bound during a time that is defined by the application life cycle, not by some call chain active in some thread. Why would one implement all this inside ScopedValue?</div></div><div><br></div></div></blockquote><div><br></div><div>The way I imagine, is that in the future you could design an application around scopes (in the abstract, SV is just a visible thing in the scope). That is, all your application is a single tree of scopes, and all the application code is within a scope. In this world, scopes would be a natural candidate to be used as DI contexts, because scopes have a well defined life-cycle, and that would make arguing about the lifetime and ownership (and who can have access to them) of resources easy. To me at least it is always a big pain point that it is hard to prove that a resource that has a given lifetime is not used outside its lifetime, and also that I can limit its life to a minimum. And since scopes would/could be the owner of resources, it makes sense to inject them via the scopes as well (since you know that whatever you injected this way is alive at that point).</div><div> </div></div></div>