On Thu, Jul 4, 2024, at 5:48 AM, Rob Landers wrote:

> If I could have one to be a PER first, it would be the container 
> interface (PSR-11). When it was originally worked on, there was 
> basically one lifecycle of an object: a request. For almost all 
> possible SAPIs, after the request ended, everything was gone. Today, we 
> basically have multiple ones if you are using modern runtimes:
>  1. Environment Scope: configuration that survives execution of the 
> program
>  2. Global Scope: services/entities that can exist beyond the lifetime 
> of a request, but may or may not (depending on runtime)
>  3. Request Scope: services/entities that should be unique for every 
> request.
>  4. Volatile Scope: services/entities that should be created every time 
> they are injected.
> Right now, these are all mixed into one giant container, that may or 
> may not be shared between requests, because that is the interface we 
> have to work with. It isn't great :| but it works, barely.
>
> — Rob

There's been on and off discussion this year about container registration, not 
just retrieval.  That could be done as an add-on PSR, most likely.  The 
challenge is that there's fundamentally different ways to go about 
registration, and little consensus on it.  (And the people most interested in 
talking about it haven't wanted to go to the effort of organizing a Working 
Group.)  I suspect scoping would have similar challenges.  But if someone can 
get a working group together around a particular direction, we'd be open to 
that discussion.

That would be entirely off topic for this list, though, so let's not go further 
down that rabbit hole.

--Larry Garfield

Reply via email to