SOLID Principles in Clojure


#1

Summary: The SOLID principles are guidelines for writing good Object-Oriented code. It turns out that these principles are followed and embodied in Clojure.


#2

I liked this post a lot! I first read about SOLID around a year ago, but I didn’t have enough programming experience to understand it. This post made some of the ideas click for me.

Recently I’ve been learning Om Next and the way it handles data. In many current React applications, components read and write to an application state atom, which means the components need to have lower-level knowledge of the atom’s structure. On the other hand in Om Next, first you write a higher-level language to read and mutate application state, and then you have your components use this language, so they never have to access the application state atom directly. Would this be an example of the Dependency Inversion Principle?


#3

Hi Eric, I haven’t seen you since Clojure Conj last year. I hope all is well!

Re SOLID - I think it has value in being a ‘thinking tool’ to look at your code.

That said - there is room to critique and even debunk SOLID itself - and Kevin Henney has done that: http://yowconference.com.au/slides/yow2013/Henney-SOLIDDeconstruction.pdf