Good explanation, and the section on not adding an interface for everything is the one most write-ups leave out. I'd add that this matters more now that agents write a lot of first drafts. Left to themselves they construct the concrete sender inside the service every time, because that's the shape most of the training data has, and they will also add an interface for a class that will only ever have one implementation if you tell them to 'apply SOLID'. Both need a rule in the repo. The agent side of DIP, if useful: prickles.org/tenet/dependency-inversion-principle…
Really good insight and it matches what I've seen too. AI just reproduce whatever data they are trained on and most real-world code out there uses dependency inline. The flip side you mentioned is more interesting. Tell an agent to apply SOLID and it treats DIP as an interface regardless of whether it needs or not. Also, the Prickles article you have mentioned is helpful too as you have mentioned the "why" part in detail and also how AI agents use DIP.
Adam Lewis
Product Engineer/Architect navigating the AI revolution
Good explanation, and the section on not adding an interface for everything is the one most write-ups leave out. I'd add that this matters more now that agents write a lot of first drafts. Left to themselves they construct the concrete sender inside the service every time, because that's the shape most of the training data has, and they will also add an interface for a class that will only ever have one implementation if you tell them to 'apply SOLID'. Both need a rule in the repo. The agent side of DIP, if useful: prickles.org/tenet/dependency-inversion-principle…