Hi @mwop,

Thank you for your comments.

I am writing inline for I don't miss anything.

> The only concern to me is
> > https://github.com/container-interop/container-interop/issues/69
> regarding
> > return value of get .
> >
> > Basically this is the text :
> >
> > Two successive calls to get with the same identifier SHOULD return the
> same
> > value. However, depending on the implementor design and/or user
> > configuration, different values might be returned, so user SHOULD NOT
> rely
> > on getting the same value on 2 successive calls.
> >
> > I don't want to drag everyone again to the same discussion. But I wonder
> if
> > there is any implementors having any concern about the same.
>
> No issues from my POV as maintainer on zend-servicemanager.
>
> The reason is thus: we have always supported a concept of "shared"
> services. Services are shared by default, but when configuring the
> container, you can mark a service as "not shared"; this can be useful
> when a particular service *should* have multiple instances.


1. According to this PSR itself configuring a service is out of scope. So
different implementors have different ways. And some of them don't have any
way itself. ( Eg : Aura.Di ) . It has newInstance method (
https://github.com/auraphp/Aura.Di/blob/76824bdeae99e46e6ae06f29e4bdf86063da86b9/src/Container.php#L531
)
to get new instance each time.

2. I love this issue
https://github.com/container-interop/container-interop/issues/44 for the
same . According to https://gist.github.com/mnapoli/6159681 there are some
implementations that rely on make() we probably needs something else
though. I noticed you suggested zf3 uses build. We can look into naming
later.

You can argue that you can pass an extra parameter to get ( I am looking at
https://github.com/container-interop/container-interop/issues/6#issuecomment-30773191
)
or create wrappers like
https://github.com/container-interop/container-interop/issues/69#issuecomment-251050021
. But the problem is in-consistency with get method on different containers.

As an
> example, our EventManager is not designed to be shared between
> different services, but has a constructor pattern that *does* require
> access to other services, and thus management by the container.
>

Sorry that I am not familiar with Zend EventManager for the current time. I
will try to find some code or docs what you were pointing to.


> Similarly, Pimple 1 separated shared from unshared services, and v3
> allows you to make services unshared by mapping a service to the
> return of the container's factory() method.
>

Yes you are right, that is where we were arguing
https://github.com/container-interop/container-interop/issues/69


> While it could be considered niche functionality, having the ability
> to act in this way covers a more generalized set of functionality,
> which, more importantly, is already seen in existing implementations,
> making it useful to the specification.
>

I would say as this PSR don't care how the configuration of DI is done, it
will be good to have one more method according to me which can return new
instances.

I don't care about the name that is going to be used, but a consistency
would always be nice.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups "PHP 
Framework Interoperability Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/php-fig/CAESZFtJooDp%2BSnu9By5pv5pcyLR7rY0bd2_A06CFf1bEDFWFvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to