While rewriting #19843 (which is a similar pr) I'v discovered one issue you were raising in the last meeting as well. It looks awkward when an extension is implementing AssociationAwareInterface and at the same time a AssociationsNotImplementedException exception can be thrown. I know code wise it is correct, but from a logical point of view it is questionable if this is really the way to go.
That's why I made #20127 which showcases a generic service locator. The big drawback on that approach is that we do not have typed return values anymore.
It looks awkward when an extension is implementing AssociationAwareInterface and at the same time a AssociationsNotImplementedException
I agree - it's just the price of supporting the legacy implementation. I discussed this at length with Nic in Holland and the eventual outcome was it was less painful to have the exception than to loose the typehint (as the exception can easily be removed in j5 or whatever - but modifying an interface is a hard b/c break)
Don't think so it is a BC break problem. It reveals the problems when one extension is supporting associations and another not and both are using the default Component service provider.
Changed Title to be clear its about 4.0.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/20170.