{"id":7385,"date":"2020-07-13T20:54:36","date_gmt":"2020-07-13T18:54:36","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=7385"},"modified":"2020-07-13T11:55:57","modified_gmt":"2020-07-13T09:55:57","slug":"the-s-o-l-i-d-principles-in-pictures","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2020\/07\/13\/the-s-o-l-i-d-principles-in-pictures\/","title":{"rendered":"The S.O.L.I.D Principles in Pictures"},"content":{"rendered":"<blockquote><p>If you are familiar with Object-Oriented Programming, then you\u2019ve probably heard about the SOLID principles.<\/p><\/blockquote>\n<p><span class=\"ar cj et at br eu ev ew ex ey eh\"><a class=\"co cp ba bb bc bd be bf bg bh ez bk fa fb\" href=\"https:\/\/medium.com\/@ugonnat?source=post_page-----b34ce2f1e898----------------------\" rel=\"noopener\">Ugonna Thelma<\/a><\/span> explains <em><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\">The S.O.L.I.D Principles in Pictures<\/a> <\/em>and she explains them very well.<\/p>\n<p>In fact I shall admit that while I&#8217;ve interiorized the S, the O, the L and the I, I always tend to forget the &#8220;Dependency injection&#8221; principle. Now it&#8217;s really clear!<\/p>\n<p><!--more--><!--nextpage--><\/p>\n<blockquote>\n<h1 id=\"4917\" class=\"do dp as dq b dr ds dt du dv dw dx dy dz ea eb ec ed ee ef eg eh\">The S.O.L.I.D Principles in Pictures<\/h1>\n<div class=\"ei\">\n<div class=\"n ej ek el em\">\n<div class=\"o n\">\n<div class=\"er n o es\"><a href=\"https:\/\/medium.com\/@ugonnat?source=post_page-----b34ce2f1e898----------------------\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"r en eo ep\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/2bveoh12R-5thGMYGTkV74A.jpeg?resize=48%2C48&#038;ssl=1\" alt=\"Ugonna Thelma\" width=\"48\" height=\"48\"\/><\/a><span class=\"ar cj et at br eu ev ew ex ey eh\"><a class=\"co cp ba bb bc bd be bf bg bh ez bk fa fb\" href=\"https:\/\/medium.com\/@ugonnat?source=post_page-----b34ce2f1e898----------------------\" rel=\"noopener\">Ugonna Thelma<\/a><\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n fv fw fx fy fz ga gb gc y\">\n<div class=\"n o\">\n<div class=\"gd r ao\"><\/div>\n<\/div>\n<\/div>\n<section class=\"di dj dk dl dm\">\n<div class=\"gi\">\n<div class=\"n p\">\n<div class=\"gj gk gl gm gn go ae gp af gq ah ai\">\n<figure class=\"gs gt gu gv gw gi gx gy paragraph-image\"><figcaption class=\"hq hr dc da db hs ht ar cj et at aw\" data-selectable-paragraph=\"\"><strong class=\"ar hu\"><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/1wrxj0oBKpA_GXb8LPhXOeg.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a>*All illustrations in this article are by <\/strong><a class=\"hv ay fu\" href=\"https:\/\/medium.com\/u\/139892399b5e?source=post_page-----b34ce2f1e898----------------------\" target=\"_blank\" rel=\"noopener noreferrer\"><strong class=\"ar hu\">Ugonna Thelma<\/strong><\/a><\/figcaption><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"7ed2\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If you are familiar with <a class=\"co fu it iu iv iw\" href=\"https:\/\/en.wikipedia.org\/wiki\/Object-oriented_programming\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">Object-Oriented Programming<\/a>, then you\u2019ve probably heard about the <a class=\"co fu it iu iv iw\" href=\"https:\/\/en.wikipedia.org\/wiki\/SOLID\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><strong class=\"ic ix\">SOLID<\/strong><\/a> principles.<\/p>\n<p id=\"6a54\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">These five software development principles are guidelines to follow when building software so that it is easier to scale and maintain. They were made popular by a software engineer, <a class=\"co fu it iu iv iw\" href=\"https:\/\/en.wikipedia.org\/wiki\/Robert_C._Martin\" target=\"_blank\" rel=\"noopener nofollow noreferrer\">Robert C. Martin<\/a>.<\/p>\n<p id=\"8be0\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">There are so many great articles online about <strong class=\"ic ix\">SOLID<\/strong> but I rarely see any examples with pictures. This makes it a bit difficult for visual learners like me to learn while staying engaged.<\/p>\n<p id=\"a931\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">So the main aim of this article is to get a better understanding of these principles using illustrations and emphasizing the goal for each principle.<\/p>\n<p id=\"607e\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">You see, some of these principles may look similar but they are not targeting <strong class=\"ic ix\">the same goal<\/strong>. It is possible to satisfy one principle while violating the other, even though they are alike.<\/p>\n<p id=\"de05\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">To make this as simple to follow, I will be using the word \u201c<strong class=\"ic ix\">Class\u201d<\/strong> but note that it can also apply to a <strong class=\"ic ix\">Function<\/strong>, <strong class=\"ic ix\">Method<\/strong> or <strong class=\"ic ix\">Module<\/strong> in this article.<\/p>\n<p id=\"e2db\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">Now, let\u2019s begin!<\/p>\n<h1 id=\"29fe\" class=\"iy iz as ar hu ja jb jc jd je jf jg jh ji jj jk jl jm jn jo jp eh\" data-selectable-paragraph=\"\">The SOLID Principles<\/h1>\n<h2 id=\"8699\" class=\"jq iz as ar hu jr js if jt ju ii jv jw il jx jy io jz ka ir kb eh\" data-selectable-paragraph=\"\">S \u2014 Single Responsibility<\/h2>\n<blockquote class=\"kc\">\n<p id=\"4038\" class=\"kd ke as dq b kf kg kh ki kj kk is aw\" data-selectable-paragraph=\"\">A class should have a single responsibility<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<div class=\"gi\">\n<div class=\"n p\">\n<div class=\"gj gk gl gm gn go ae gp af gq ah ai\">\n<figure class=\"kl km kn ko kp gi gx gy paragraph-image\">\n<div class=\"gz ha hb hc ai\">\n<div class=\"da db gr\">\n<div class=\"hi r hb hj\">\n<div class=\"kq hl r\">\n<div class=\"hd he s t u hf ai br hg hh\"><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full aligncenter\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/1P3oONz9Da3Tc1w97fMV73Q.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"4600\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If a Class has many responsibilities, it increases the possibility of bugs because making changes to one of its responsibilities, could affect the other ones without you knowing.<\/p>\n<p id=\"9317\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Goal<\/strong><\/p>\n<p id=\"5184\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">This principle aims to separate behaviours so that if bugs arise as a result of your change, it won\u2019t affect other unrelated<a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/10MtFBmm6L2WVM04qCJOZPQ.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a> behaviours.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"kr cj ks kt ku kv hr kw kx ky kz la\"\/>\n<section class=\"di dj dk dl dm\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<h2 id=\"3984\" class=\"jq iz as ar hu jr js if jt ju ii jv jw il jx jy io jz ka ir kb eh\" data-selectable-paragraph=\"\">O \u2014 Open-Closed<\/h2>\n<blockquote class=\"kc\">\n<p id=\"8801\" class=\"kd ke as dq b kf kg kh ki kj kk is aw\" data-selectable-paragraph=\"\">Classes should be open for extension, but closed for modification<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<div class=\"gi\">\n<div class=\"n p\">\n<div class=\"gj gk gl gm gn go ae gp af gq ah ai\">\n<figure class=\"kl km kn ko kp gi gx gy paragraph-image\">\n<div class=\"gz ha hb hc ai\">\n<div class=\"da db gr\">\n<div class=\"hi r hb hj\">\n<div class=\"lb hl r\">\n<div class=\"hd he s t u hf ai br hg hh\"><\/div>\n<p><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full aligncenter\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/10MtFBmm6L2WVM04qCJOZPQ-1.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"1739\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">Changing the current behaviour of a Class will affect all the systems using that Class.<\/p>\n<p id=\"9684\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If you want the Class to perform more functions, the ideal approach is to add to the functions that already exist NOT change them.<\/p>\n<p id=\"d887\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Goal<\/strong><\/p>\n<p id=\"a4ce\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">This principle aims to extend a Class\u2019s behaviour without changing the existing behaviour of that Class. This is to avoid causing bugs wherever the Class is being used.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"kr cj ks kt ku kv hr kw kx ky kz la\"\/>\n<section class=\"di dj dk dl dm\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"dc58\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">L <\/strong>\u2014 <strong class=\"ic ix\">Liskov Substitution<\/strong><\/p>\n<blockquote class=\"kc\">\n<p id=\"c27e\" class=\"kd ke as dq b kf lc ld le lf lg is aw\" data-selectable-paragraph=\"\">If S is a subtype of T, then objects of type T in a program may be replaced with objects of type S without altering any of the desirable properties of that program.<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<div class=\"gi\">\n<div class=\"n p\">\n<div class=\"gj gk gl gm gn go ae gp af gq ah ai\">\n<figure class=\"kl km kn ko kp gi gx gy paragraph-image\">\n<div class=\"gz ha hb hc ai\">\n<div class=\"da db lh\">\n<div class=\"hi r hb hj\">\n<div class=\"li hl r\">\n<div class=\"hd he s t u hf ai br hg hh\"><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/1yKk2XKJaCLNlDxQMx1r55Q.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"8b03\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">When a <strong class=\"ic ix\">child<\/strong> Class cannot perform the same actions as its <strong class=\"ic ix\">parent<\/strong> Class, this can cause bugs.<\/p>\n<p id=\"9b16\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If you have a Class and create another Class from it, it becomes a <strong class=\"ic ix\">parent<\/strong> and the new Class becomes a <strong class=\"ic ix\">child. <\/strong>The <strong class=\"ic ix\">child<\/strong> Class should be able to do everything the <strong class=\"ic ix\">parent<\/strong> Class can do. This process is called <strong class=\"ic ix\">Inheritance<\/strong>.<\/p>\n<p id=\"1eba\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">The <strong class=\"ic ix\">child<\/strong> Class should be able to process the same requests and deliver the same result as the <strong class=\"ic ix\">parent<\/strong> Class or it could deliver a result that is of the same type.<\/p>\n<p id=\"9303\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">The picture shows that the <strong class=\"ic ix\">parent<\/strong> Class delivers Coffee(it could be any type of coffee). It is acceptable for the <strong class=\"ic ix\">child<\/strong> Class to deliver Cappucino because it is a specific type of Coffee, but it is NOT acceptable to deliver Water.<\/p>\n<p id=\"a96d\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If the <strong class=\"ic ix\">child<\/strong> Class doesn\u2019t meet these requirements, it means the <strong class=\"ic ix\">child<\/strong> Class is changed completely and violates this principle.<\/p>\n<p id=\"559b\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Goal<\/strong><\/p>\n<p id=\"15af\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">This principle aims to enforce consistency so that the parent Class or its child Class can be used in the same way without any errors.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"kr cj ks kt ku kv hr kw kx ky kz la\"\/>\n<section class=\"di dj dk dl dm\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"7c89\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">I <\/strong>\u2014 <strong class=\"ic ix\">Interface Segregation<\/strong><\/p>\n<blockquote class=\"kc\">\n<p id=\"0d11\" class=\"kd ke as dq b kf lc ld le lf lg is aw\" data-selectable-paragraph=\"\">Clients should not be forced to depend on methods that they do not use.<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<div class=\"gi ai\">\n<figure class=\"kl km kn ko kp gi ai paragraph-image\">\n<div class=\"gz ha hb hc ai\">\n<div class=\"hi r hb hj\">\n<div class=\"lj hl r\">\n<div class=\"hd he s t u hf ai br hg hh\"><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full aligncenter\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/12hmyR9L43Vm64MYxj4Y89w.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"6f37\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">When a Class is required to perform actions that are not useful, it is wasteful and may produce unexpected bugs if the Class does not have the ability to perform those actions.<\/p>\n<p id=\"d77d\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">A Class should perform only actions that are needed to fulfil its role. Any other action should be removed completely or moved somewhere else if it might be used by another Class in the future.<\/p>\n<p id=\"6f20\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Goal<\/strong><\/p>\n<p id=\"b602\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><mark class=\"wq wr ne\">This principle aims at splitting a set of actions into smaller sets so that a Class executes ONLY the set of actions it requires.<\/mark><\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"kr cj ks kt ku kv hr kw kx ky kz la\"\/>\n<section class=\"di dj dk dl dm\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"f8b5\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">D <\/strong>\u2014 <strong class=\"ic ix\">Dependency Inversion<\/strong><\/p>\n<blockquote class=\"kc\">\n<p id=\"d2f4\" class=\"kd ke as dq b kf lc ld le lf lg is aw\" data-selectable-paragraph=\"\">&#8211; High-level modules should not depend on low-level modules. Both should depend on the abstraction.<\/p>\n<p id=\"e1f4\" class=\"kd ke as dq b kf kg kh ki kj kk is aw\" data-selectable-paragraph=\"\">&#8211; Abstractions should not depend on details. Details should depend on abstractions.<\/p>\n<\/blockquote>\n<\/div>\n<\/div>\n<div class=\"gi\">\n<div class=\"n p\">\n<div class=\"gj gk gl gm gn go ae gp af gq ah ai\">\n<figure class=\"kl km kn ko kp gi gx gy paragraph-image\">\n<div class=\"gz ha hb hc ai\">\n<div class=\"da db lh\">\n<div class=\"hi r hb hj\">\n<div class=\"lk hl r\">\n<div class=\"hd he s t u hf ai br hg hh\"><a href=\"https:\/\/medium.com\/backticks-tildes\/the-s-o-l-i-d-principles-in-pictures-b34ce2f1e898\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"size-full aligncenter\" src=\"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/07\/1Qk8tDmjQlyvwKxNTfXIo0Q.png?w=910&#038;ssl=1\" alt=\"\"\/><\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<p id=\"9dd0\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">Firstly, let\u2019s define the terms used here more simply<\/p>\n<p id=\"dc4a\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">High-level Module(or Class)<\/strong>: Class that executes an action with a tool.<\/p>\n<p id=\"2d1e\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Low-level Module (or Class)<\/strong>: The tool that is needed to execute the action<\/p>\n<p id=\"74eb\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Abstraction<\/strong>: Represents an interface that connects the two Classes.<\/p>\n<p id=\"837e\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Details<\/strong>: How the tool works<\/p>\n<p id=\"bc2d\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">This principle says a Class should not be fused with the tool it uses to execute an action. Rather, it should be fused to the interface that will allow the tool to connect to the Class.<\/p>\n<p id=\"a53a\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">It also says that both the Class and the interface should not know how the tool works. However, the tool needs to meet the specification of the interface.<\/p>\n<p id=\"4535\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\"><strong class=\"ic ix\">Goal<\/strong><\/p>\n<p id=\"cb99\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">This principle aims at reducing the dependency of a high-level Class on the low-level Class by introducing an interface.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<hr class=\"kr cj ks kt ku kv hr kw kx ky kz la\"\/>\n<section class=\"di dj dk dl dm\">\n<div class=\"n p\">\n<div class=\"z ab ac ae af dn ah ai\">\n<h1 id=\"606d\" class=\"iy iz as ar hu ja ll jc jd lm jf jg ln ji jj lo jl jm lp jo jp eh\" data-selectable-paragraph=\"\">Summary<\/h1>\n<p id=\"498e\" class=\"ia ib as ic b id lq if ig lr ii ij ls il im lt io ip lu ir is di eh\" data-selectable-paragraph=\"\">So far, we have discussed these five principles and highlighted their goals. They are to help you make your code easy to adjust, extend and test with little to no problems.<\/p>\n<p id=\"79fd\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">Thank you so much for reading. I hope you have a better idea about this topic and you had as much fun reading this as I did writing it.<\/p>\n<p id=\"c4c4\" class=\"ia ib as ic b id ie if ig ih ii ij ik il im in io ip iq ir is di eh\" data-selectable-paragraph=\"\">If you have any questions or suggestions, leave a comment or reach out to me on Twitter<a class=\"co fu it iu iv iw\" href=\"http:\/\/twitter.com\/@jattorize\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><strong class=\"ic ix\"><em class=\"lv\">@<\/em><\/strong><\/a><a class=\"co fu it iu iv iw\" href=\"https:\/\/twitter.com\/ugonna_t\" target=\"_blank\" rel=\"noopener nofollow noreferrer\"><strong class=\"ic ix\">ugonna_t<\/strong><\/a>.<\/p>\n<\/div>\n<\/div>\n<\/section>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">If you are familiar with Object-Oriented Programming, then you\u2019ve probably heard about the SOLID principles. Ugonna Thelma explains The S.O.L.I.D Principles in Pictures and she explains them very well. In fact I shall admit that while I&#8217;ve interiorized the S, the O, the L and the I, I always tend to forget the &#8220;Dependency injection&#8221;&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2020\/07\/13\/the-s-o-l-i-d-principles-in-pictures\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"link","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72,34],"tags":[],"class_list":["post-7385","post","type-post","status-publish","format-link","hentry","category-documentations","category-eiffel","post_format-post-format-link"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-1V7","jetpack-related-posts":[{"id":4917,"url":"https:\/\/monodes.com\/predaelli\/2018\/11\/14\/single-responsibility-principle\/","url_meta":{"origin":7385,"position":0},"title":"Single Responsibility Principle","author":"Paolo Redaelli","date":"2018-11-14","format":false,"excerpt":"Writing Flexible Code with the Single Responsibility Principle Mhmhmm... where have I heard of that SOLID principle? Ah, Eiffel! Severin Perez Writer | Developer | Information Specialist Sep 7 Writing Flexible Code with the Single Responsibility Principle SOLID Principles and Maintainable Code Photo by NASA on\u00a0Unsplash If you\u2019ve been around\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":4948,"url":"https:\/\/monodes.com\/predaelli\/2018\/11\/19\/maintainable-code-and-the-open-closed-principle-severin-perez-medium\/","url_meta":{"origin":7385,"position":1},"title":"Maintainable Code and the Open-Closed Principle \u2013 Severin Perez \u2013 Medium","author":"Paolo Redaelli","date":"2018-11-19","format":false,"excerpt":"A Look at the Open-Closed Principle in JavaScript Maintainable Code and the Open-Closed Principle \u2013 Severin Perez \u2013 Medium Oh, another interesting article that tries to educate the \"unliterate\" JavaScript masses about the basic principle behind Eiffel..... Maintainable Code and the Open-Closed Principle Abstraction and the Open-Closed Principle in JavaScript\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1771,"url":"https:\/\/monodes.com\/predaelli\/2016\/09\/17\/reform-copyright\/","url_meta":{"origin":7385,"position":2},"title":"Reform Copyright","author":"Paolo Redaelli","date":"2016-09-17","format":false,"excerpt":"Reform Copyright Education, parody, photography, and remix shouldn\u2019t be unlawful online. It\u2019s time to set our imaginations free in the EU \u2014 sign Mozilla\u2019s petition: Reform Copyright It's time our laws caught up with our technology. Did you know making a meme technically isn't allowed in many parts of the\u2026","rel":"","context":"In &quot;Copyright&quot;","block_context":{"text":"Copyright","link":"https:\/\/monodes.com\/predaelli\/category\/copyright\/"},"img":{"alt_text":"","src":"https:\/\/d3n8a8pro7vhmx.cloudfront.net\/mozillafoundation\/pages\/19\/attachments\/original\/1471399032\/1f4a5.svg?1471399032","width":350,"height":200,"srcset":"https:\/\/d3n8a8pro7vhmx.cloudfront.net\/mozillafoundation\/pages\/19\/attachments\/original\/1471399032\/1f4a5.svg?1471399032 1x, https:\/\/d3n8a8pro7vhmx.cloudfront.net\/mozillafoundation\/pages\/19\/attachments\/original\/1471399032\/1f4a5.svg?1471399032 1.5x"},"classes":[]},{"id":5033,"url":"https:\/\/monodes.com\/predaelli\/2018\/12\/10\/sans-forgetica-rmit\/","url_meta":{"origin":7385,"position":3},"title":"Sans Forgetica &#8211; RMIT","author":"Paolo Redaelli","date":"2018-12-10","format":false,"excerpt":"Sans Forgetica is a typeface designed using the principles of cognitive psychology to help you to better remember your study notes. Source: Sans Forgetica - RMIT","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1500,"url":"https:\/\/monodes.com\/predaelli\/2016\/05\/05\/object-oriented-and-functional-programming\/","url_meta":{"origin":7385,"position":4},"title":"Object oriented and functional programming","author":"Paolo Redaelli","date":"2016-05-05","format":false,"excerpt":"\u00a0Object oriented and functional programming Learn how functional programming can help you implement the SOLID design principles. I shall attend this as soon as possible \u00a0 \u00a0 \u00a0","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2340,"url":"https:\/\/monodes.com\/predaelli\/2017\/04\/02\/modules-vs-microservices\/","url_meta":{"origin":7385,"position":5},"title":"Modules vs. microservices","author":"Paolo Redaelli","date":"2017-04-02","format":"link","excerpt":"Apply modular system design principles while avoiding the operational complexity of microservices. Modules vs. microservices Modules vs. microservices Apply modular system design principles while avoiding the operational complexity of microservices. By Sander Mak March 24, 2017 Container (source: Antranias). Register for the O'Reilly Software Architecture Conference in New York, April\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=7385"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7385\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=7385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=7385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=7385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}