Below are example tests that leverages all the advantages provided by solid.

Now there is a clear way to inject dependencies and we don't need to implement the whole email class. No longer does the code reach a real email server and all without the use of a library, just simple programming. The dependencies are fed in from outside the scope, and thus not constructed within a class. This gives profound ability to move code around, add new functionality and have no need to bootstrap the entire app just to test a small slice of it

Some of the examples are contrived, and some functions aren’t perfectly one responsibility but I hope you get the idea of what these principals can achieve.

Conclusion

On the surface solid revolves around interfaces in most of its principals. This is because interfaces are inherently an abstract construct not depending on any concretions. Code interactions are now loose contracts that can be adhered to by anything.

This produces a very loose coupling. With single or few method interfaces making your code base only depend on what it needs to, refactoring and mocking become simplified. Paired with Single responsibility which is having units of your code be responsible for one thing leads to abstractions at every level.

This abstraction along with defining of api boundaries with interfaces allows the slotting in and out and refactoring of code with minimal impact on the rest of the code base.

Below are a curated resources that have helped me in forming a more complete understanding of SOLID and some other general programming principles are mantras.

Last but not least… Don’t forget all caps when you spell SOLID name [10]

1: https://stackify.com/solid-design-principles/ Long but good examples of solid in java

2: https://en.wikipedia.org/wiki/SOLID Wiki on solid

3: https://blog.cleancoder.com/uncle-bob/2014/05/12/TheOpenClosedPrinciple.html Open close (uncle Bob)

4: https://www.youtube.com/watch?v=zzAdEt3xZ1M Golang solid talk

5: https://www.ardanlabs.com/blog/2017/02/package-oriented-design.html Folder layout for golang but can be adapted to other langs

6: https://blog.cleancoder.com/uncle-bob/2014/05/08/SingleReponsibilityPrinciple.html Single responsibhility (uncle Bob)

7: https://en.wikipedia.org/wiki/Composition_over_inheritance Composition over inheritance

8: https://reactjs.org/docs/composition-vs-inheritance.html React Composition vs Inheritance

9: https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle#Polymorphic_open/closed_principle Polymorphic open close

10: https://www.youtube.com/watch?v=ewc1hixzYPY ALL CAPS

11: https://medium.com/@cep21/what-accept-interfaces-return-structs-means-in-go-2fe879e25ee8 ‘Accept interfaces return structs’ (golang idiom) ‘accept interfaces return concretions’ as a more general term