---
title: "Comment by Adam Lewis on \"SOLID Principles Simplified #5: Dependency Inversion Principle\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/solid-principles-simplified-5-dependency-inversion-principle/6a96c70667ee31ea285945ef/comment/6a97f10301863d8fcde4be16"
---

[Discussion](https://hashnode.com/posts/solid-principles-simplified-5-dependency-inversion-principle/6a96c70667ee31ea285945ef)

Comment [SOLID Principles Simplified #5: Dependency Inversion Principle](https://hashnode.com/posts/solid-principles-simplified-5-dependency-inversion-principle/6a96c70667ee31ea285945ef)

[Adam Lewis](https://hashnode.com/@nark3d)

[Sep 2](https://hashnode.com/posts/solid-principles-simplified-5-dependency-inversion-principle/6a96c70667ee31ea285945ef/comment/6a97f10301863d8fcde4be16)

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…](https://prickles.org/tenet/dependency-inversion-principle/A11)

[Onkesh Gupta](https://hashnode.com/@onkeshgupta)

[Sep 2](https://hashnode.com/posts/solid-principles-simplified-5-dependency-inversion-principle/6a96c70667ee31ea285945ef/comment/6a97f10301863d8fcde4be16#reply-6a986375e3600e2655f0f95c)

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.
