Do we still need \OCP\IContainer?

Let me present a shower thought to you: I don’t think we need the \OCP\IContainer abstraction anymore. This interface currently handles both the registration as well as the resolving of services on a DI container. As of the new bootstrap mechanism, the registration has a new place and API, so apps don’t really have a reason to use \OCP\IContainer::registerService (and similar) directly, right?

If we phase out the registration aspect of the interface we’re left with the resolve and query methods (which I can’t quite differentiate between :speak_no_evil:). Which then in turn means we’re basically down to the the PSR11 container interface.

So what is the point of replacing our existing interface with PSR one? IMO we can use more of the standards and benefit from easier interop with libraries and components. Also I’m more in favor of re-using existing and established APIs than building everything ourselves.

End of shower though.

What do you think?

1 Like

Yep lets go the PSR way

1 Like

PR at https://github.com/nextcloud/server/pull/21809