{"id":724,"date":"2023-12-09T21:27:10","date_gmt":"2023-12-09T20:27:10","guid":{"rendered":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=724"},"modified":"2024-01-16T11:26:15","modified_gmt":"2024-01-16T10:26:15","slug":"solid-zasada-podstawienia-liskov","status":"publish","type":"post","link":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=724","title":{"rendered":"SOLID &#8211; Zasada podstawienia Liskov"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"724\" class=\"elementor elementor-724\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-716e45a elementor-section-full_width elementor-section-stretched elementor-section-height-default elementor-section-height-default\" data-id=\"716e45a\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;stretch_section&quot;:&quot;section-stretched&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ae8118f\" data-id=\"ae8118f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-165f795 elementor-widget__width-initial elementor-widget elementor-widget-qi_addons_for_elementor_section_title\" data-id=\"165f795\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"qi_addons_for_elementor_section_title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"qodef-shortcode qodef-m  qodef-qi-section-title  qodef-decoration--italic  qodef-link--underline-draw qodef-subtitle-icon--left\">\n\t\t\t\t\t\t<h2 class=\"qodef-m-title\">\n\t\tSOLID - Zasada podstawiania Liskov\t<\/h2>\n\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-89f84d1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"89f84d1\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7da7745\" data-id=\"7da7745\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f2378aa elementor-widget elementor-widget-text-editor\" data-id=\"f2378aa\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Kluczowa zasada do zapewnienia elastyczno\u015bci i rozszerzalno\u015bci kodu. Umo\u017cliwia tworzenie hierarchii klas, kt\u00f3re mog\u0105 efektywnie wsp\u00f3\u0142pracowa\u0107 i by\u0107 rozbudowywane.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c552f35 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c552f35\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-288cef3\" data-id=\"288cef3\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2f7f25e elementor-widget elementor-widget-text-editor\" data-id=\"2f7f25e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><a href=\"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=695\"><strong>S <\/strong>&#8211; Zasada pojedynczej odpowiedzialno\u015bci (Single Responsibility Principle &#8211; SRP)<\/a><\/p><p><a href=\"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=704\"><strong>O<\/strong> &#8211; Zasada otwarte-zamkni\u0119te (Open-Close Principle &#8211; OCP)<\/a><\/p><p><strong>L<\/strong> <strong>&#8211; Zasada podstawiania Liskov (Liskov Substitution Principle &#8211; LSP)<\/strong><\/p><p><a href=\"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=735\"><strong>I<\/strong> &#8211; Zasada segregacji interfejsu (Interface Segregation Principle &#8211; ISP)<\/a><\/p><p><a href=\"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/?p=749\"><strong>D<\/strong> &#8211; Zasada odwr\u00f3cenia zale\u017cno\u015bci (Dependency Inversion Principle &#8211; DIP)<\/a><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ea11e48 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ea11e48\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f441993\" data-id=\"f441993\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-77d03b5 elementor-widget elementor-widget-heading\" data-id=\"77d03b5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Definicja<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-bc42975 elementor-widget elementor-widget-text-editor\" data-id=\"bc42975\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Ka\u017cda klasa pochodna powinna by\u0107 zast\u0119powalna przez swoj\u0105 klas\u0119 bazow\u0105 bez naruszania poprawno\u015bci programu.<\/p><p>Oznacza to, \u017ce klasa pochodna powinna zachowywa\u0107 si\u0119 tak samo jak klasa bazowa i nie wprowadza\u0107 \u017cadnych nieoczekiwanych zmian lub ogranicze\u0144. Dodatkowo warunki wst\u0119pne w podklasie nie mog\u0105 by\u0107 trudniejsze do spe\u0142nienia ni\u017c w klasie po kt\u00f3rej dziedziczy, a warunki ko\u0144cowe w podklasie nie mog\u0105 by\u0107 \u0142atwiejsze do spe\u0142nienia ni\u017c w klasie w bazowej. Je\u015bli nie\u00a0klasa pochodna jest zast\u0119powalna przez swoj\u0105 klas\u0119 bazow\u0105, to \u0142amie zasad\u0119 LSP i powoduje problemy z polimorfizmem, dziedziczeniem i abstrakcj\u0105.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ab5a3d7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ab5a3d7\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-559ebbc\" data-id=\"559ebbc\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1bf8dca elementor-widget elementor-widget-heading\" data-id=\"1bf8dca\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Przyk\u0142ad<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-65a4545 elementor-widget elementor-widget-text-editor\" data-id=\"65a4545\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Stw\u00f3rzmy klas\u0119 Bird ze wsp\u00f3lnymi cechami ptak\u00f3w, w tym metod\u0105 fly(), kt\u00f3ra b\u0119dzie rozszerza\u0107 klasy Sparrow i Penguin.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ccc57a5 elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"ccc57a5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Bird {\n    \/\/Wsp&oacute;lne cechy ptak&oacute;w\n    String name;\n    public void fly(){\n        System.out.println(name + &quot; leci&quot;);\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-88283e3 elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"88283e3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Sparrow extends Bird {\n    public Sparrow() {\n        this.name = &quot;Elemelek&quot;;\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-302150f elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"302150f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Penguin extends Bird{\n    public Penguin() {\n        this.name = &quot;Jakub&quot;;\n    }\n\n    @Override\n    public void fly() {\n        throw new UnsupportedOperationException(&quot;Pingwin nie potrafi lata\u0107&quot;);\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-720e38b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"720e38b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e870b0d\" data-id=\"e870b0d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bb06281 elementor-widget elementor-widget-text-editor\" data-id=\"bb06281\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Klasa ta \u0142amie zasad\u0119 LSP, poniewa\u017c klasa Penguin zmienia zachowanie metody fly() i wyrzuca wyj\u0105tek, przez co nie jest zast\u0119powalna przez swoj\u0105 klas\u0119 bazow\u0105 Bird.<\/p><p>Aby naprawi\u0107 ten kod nalezy zmieni\u0107 hierarchi\u0119 klas i wydzieli\u0107 wsp\u00f3lne cechy ptak\u00f3w do interfejs\u00f3w lub klas abstrakcyjnych. W ten spos\u00f3b klasy pochodne b\u0119d\u0105 implementowa\u0107 tylko te metody, kt\u00f3re s\u0105 dla nich odpowiednie i nie b\u0119d\u0105 narusza\u0107 kontraktu klasy bazowej.<\/p><p>W poprawionym kodzie doda\u0142am interfejs FlyingBird do kt\u00f3rej przenios\u0142am metod\u0119 fly(). Z kolei w klasie Bird doda\u0142am metod\u0119 eat(), kt\u00f3ra b\u0119dzie wsp\u00f3lna dla wszystkich obiekt\u00f3w dziedzicz\u0105cych po niej<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d152b1d elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"d152b1d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Bird {\n    \/\/Wsp&oacute;lne cechy ptak&oacute;w\n    String name;\n    public Bird(String name) {\n        this.name = name;\n    }\n    public void eat(){\n        System.out.println(name + &quot; je.&quot;);\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-23d5fbc elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"23d5fbc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public interface FlyingBird{\n    public void fly();\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3ca3f47 elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"3ca3f47\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Sparrow extends Bird implements FlyingBird {\n    public Sparrow(String name) {\n        super(name);\n    }\n\n    @Override\n    public void fly() {\n        System.out.println(this.name + &quot; leci&quot;);\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-240d4e2 elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"240d4e2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class Penguin extends Bird{\n    public Penguin(String name) {\n        super(name);\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-148ec23 elementor-widget elementor-widget-text-editor\" data-id=\"148ec23\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Przyk\u0142ad wywo\u0142ania:<br><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d05cead elementor-widget elementor-widget-elementor-syntax-highlighter\" data-id=\"d05cead\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"elementor-syntax-highlighter.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre><code class='language-java'>public class App\n{\n    public static void main( String[] args )\n    {\n        Sparrow sparrow = new Sparrow(&quot;Elemelek&quot;);\n        Penguin penguin = new Penguin(&quot;Jakub&quot;);\n\n        List&lt;Bird&gt; birdList = new ArrayList&lt;&gt;();\n        birdList.add(sparrow);\n        birdList.add(penguin);\n\n        List&lt;FlyingBird&gt; flyingBirds = new ArrayList&lt;&gt;();\n        flyingBirds.add(sparrow);\n        \/\/ akcja niedozwolona\n        \/\/ flyingBirds.add(penguin);\n\n        for(Bird bird: birdList){\n            bird.eat();\n        }\n\n        for(FlyingBird flyingBird: flyingBirds){\n            flyingBird.fly();\n        }\n    }\n} <\/code><\/pre><script>\nif (!document.getElementById('syntaxed-prism')) {\n\tvar my_awesome_script = document.createElement('script');\n\tmy_awesome_script.setAttribute('src','https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/wp-content\/plugins\/syntax-highlighter-for-elementor\/assets\/prism2.js');\n\tmy_awesome_script.setAttribute('id','syntaxed-prism');\n\tdocument.body.appendChild(my_awesome_script);\n} else {\n\twindow.Prism && Prism.highlightAll();\n}\n<\/script>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b0dd4f2 elementor-widget elementor-widget-text-editor\" data-id=\"b0dd4f2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Teraz klasa Penguin nie \u0142amie zasady LSP, poniewa\u017c nie implementuje w \u017caden spos\u00f3b metody fly(), kt\u00f3rej nie mog\u0142aby wywo\u0142a\u0107 w poprawny spos\u00f3b.<\/p><p>Dzi\u0119ki zastosowaniu zasady podstawienia Liskov kod sta\u0142 si\u0119 znacznie prostszy do rozszerzenia i testowania.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Trzecia zasada akronimu SOLID m\u00f3wi\u0105ca o poprawnym dziedziczeniu i implementacjach klas.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,33],"tags":[34,35,39,36],"class_list":["post-724","post","type-post","status-publish","format-standard","hentry","category-artykuly","category-czysty-kod","tag-czysty-kod","tag-java","tag-lsp","tag-solid"],"_links":{"self":[{"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=724"}],"version-history":[{"count":20,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/posts\/724\/revisions"}],"predecessor-version":[{"id":902,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=\/wp\/v2\/posts\/724\/revisions\/902"}],"wp:attachment":[{"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/klaudia-bernat.profesjonalnyprogramista.pl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}