He was just saying that while setXxx() methods need only be called once to inject a dependency, addXxx() methods might be called multiple times to register multiple things dependencies (think the delegating loader loader classes, which take format loaders).
For addXxx() cases, it would be unnecessary and even destructive to erase previous calls, unlike setXxx() methods. On Mon, Feb 7, 2011 at 8:43 AM, Lukas Kahwe Smith <[email protected]>wrote: > Hi Johannes, > > Can you elaborate? I never looked at the implementation of interface > injection so I might not be getting the obvious, but what exactly is the > concern? > > On 04.02.2011, at 09:13, Johannes Schmitt wrote: > > > I hate to crash the party, but just think of something like "addXXX". > > > > Kind regards, > > Johannes > > > > > > On Fri, Feb 4, 2011 at 1:31 AM, Bulat Shakirzyanov <[email protected]> > wrote: > > No principles are violated :) > > +1 > > > > Sent from my Nexus One > > > > On Feb 3, 2011 7:28 PM, "Jeremy Mikola" <[email protected]> wrote: > > > On Thu, Feb 3, 2011 at 6:34 PM, Lukas Kahwe Smith <[email protected] > >wrote: > > > > > >> > > >> Which reminds me, one of my concerns with interface injection is that > it > > >> injects the same service to any class implementing the given interface > with > > >> no way to individually override this. So I have been thinking if it > would > > >> make sense to add something to the DIC to detect if the same setter > defined > > >> by an interface is explicitly listed in the call section of the given > > >> service and in that case only use the explicit setter call and not the > > >> implicit one from the interface injection. > > >> > > >> This way interface injection would retain its convenience, but would > still > > >> allow customization on a case by case basis. > > >> > > > > > > Should be as simple as adding a hasMethodCall() check on the definition > > > during injector processing [1]. I'm not sure if this violates some > principle > > > of interface injection (would have to defer to Bulat on that :), but it > > > seems reasonable. I don't see the point of two method calls that would > > > likely just clobber each other anyway. > > > > > > [1] > > > > https://github.com/fabpot/symfony/blob/master/src/Symfony/Component/DependencyInjection/InterfaceInjector.php#L78 > > > > > > -- > > > jeremy mikola > > > > > > -- > > > If you want to report a vulnerability issue on symfony, please send it > to security at symfony-project.com > > > > > > You received this message because you are subscribed to the Google > > > Groups "symfony developers" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected] > > > For more options, visit this group at > > > http://groups.google.com/group/symfony-devs?hl=en > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/symfony-devs?hl=en > > > > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > Groups "symfony developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/symfony-devs?hl=en > > Lukas Kahwe Smith > [email protected] > > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/symfony-devs?hl=en > -- jeremy mikola -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
