DIP & Vitamins

I came across an interesting parallel between biology and software.

Dependency inversion principle (DIP) is key to creating portable software. The essence of this principle is defining interfaces top-down based on the needs of the software. This has the consequence of putting the requirement first instead of the underlying implementation. So, we become user-oriented instead of technology-oriented and hopefully succeed.

Vitamins, to my surprise and interest, are also defined in a similar fashion. “Vitamins are classified by their biological and chemical activity, not their structure.”[1]Vitamin, Wikipedia It is a vitamer that defines the structure of the substance which “implements” the vitamin.

So, while Uncle Bob formulated the DIP for SW in 1996 with great success, biologists were way ahead when they discovered the vitamins in 1910s.

I still don’t know why biologists chose to make this distinction in the naming of vitamins vs. vitamers. My current explanation would be that while biologists discovered the vitamins based on their biological activity, it was the chemists who discovered the exact chemical structure, thereby giving them a different name: vitamers. So, we can explain it as an anachronic observation of Conway’s Law: organization (biologists vs. chemists) dictated the concept/architecture (vitamins vs. vitamers) of the system. They didn’t have the same goal as Uncle Bob, and I’m not sure if they benefited from this distinction as much as the SW community did.

In any case, it’s fun and eye-opening to see such parallels in unrelated contexts in the spirit of connecting the dots.

Footnotes

Footnotes
1 Vitamin, Wikipedia

4 thoughts on “DIP & Vitamins

  1. Good point Dogan,
    this is I think, what we call as “Transformational Science”.
    transformational science deals with the topics that have wide implications across multiple fields, and not only in one technical area.
    i.e. : Management Science also have many analogies. Open Systems Theory of Katz&Kahn(1996) in Management, is also based on the second principle of thermodynamics(Entropy).

    1. Thank you very much for the contribution, Tolga. Entropy is a very good example. We also refer to entropy to refer in software complexity: we have to insert energy (redesign/refactoring effort) into our software to keep it simple (low amount of entropy).

  2. Can a Vitamer implement any given (I)Vitamin? Never mind, me being just nerd-funny. Such real life metaphors help to convey the principle. I may refer to this with your permission.

    1. Hi Kaan, sure go ahead, all content is released under Creative Commons. ;-)
      The problem with this metaphor is not many people know about vitamins and vitamers, so maybe a more popular metaphor would be more helpful.
      All the best for the feedback.

Leave a Reply to Kaan Cancel reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.