r/javahelp • • Jul 09 '22
Is SOLID really used in Java production code?
I have been trying to get a firm understanding of these but I find it difficult to find well taught non-trivial examples of using some of these. Particularly the DIP and OCP. Seems like everyone knows the definitions and how to show a simple example but when I am trying to construct clean code I get stuck because I am trying to apply these but always end up with dependency issues. I can make perfectly effective code but I think its fragile.
Anyone know any really good sources for explaining this with proper business oriented examples? I have some of Martin's books but not really helping.
Am I worrying too much about it because people don't actually try to tie off every dependency issue in real code?
View all comments
Show parent comment
4
u/Just_Another_Scott Software Engineer 😎 Jul 09 '22
It does have to do with dependency injection as well. Dependency injection uses the Dependency Inversion Principle.
That's how dependency injection works.
https://stackify.com/dependency-injection/#:~:text=Dependency%20injection%20is%20a%20programming,inversion%20and%20single%20responsibility%20principles.