The SOLID Commandments
Let us do something kind of sacrilegious, but of the fun kind. The SOLID principles might as well be rewritten as follows:
A. Single Responsibility Principle
Thy classes should have exactly one responsibility: a reason to change.
B. Open/Closed Principle
Thy classes ought to be open for extension, but closed for modification.
C. Liskov Substitution Principles
You shall not modify class behavior through the mechanism of inheritance.
If type S inherits from type T, then both T and S should be interchangeable in functions that expect T.
D. Interface Segregation Principle
You shall avoid writing monstrous interfaces that burden classes with responsabilities they don’t need or want. Instead, you ought to create a collection of smaller, discrete interfaces, partitioning interface members according to what they concern. Thy classes then shall pick and choose what they implement.
E. Dependency Inversion Principle
You shall depend upon abstractions, not upon concretions.
Sometimes, in diversion we see many things that are possible, show, or display something hidden about ourselves and the world. By mending religious folklore with these principles we may notice one thing, for instance: how primitive, or rather young, our engineering field is since it pretty much lends itself to wisdom, advise, and myth. There are no formalisms; just word of mouth passed generation through generation.
This isn’t a bad thing, by the way. In fact, it is quite great! Let us enjoy it before someone formalizes our field into platonic abstraction and asensual oblivion—no worries for now; Radia Perlman seems to still enjoy herself in her own Algorhyme poem. As a parallel, it is in these formative years where we have gotten language’s greatest achievements: songs and poetry. Let us notice, though, that programming languages are languages, just of a particular kind. So, who knows what many more myths, wisdom, and rhymes shall we get from software engineering in the years to come?
Fascinating.
Shall the almighty, if existing, bless the love for my field.
Guiness, E. (2013, June 24). Understanding the SOLID principles. In Guiness, E. (2013, June 24), Ace the Programming Interview: 160 Questions and Answers for Success (pp. 121-126). John Wiley & Sons.
Comments
Post a Comment