<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Open-Closed Principle on Artur Rios Lab</title><link>https://lab.artur-rios.tech/tags/open-closed-principle/</link><description>Recent content in Open-Closed Principle on Artur Rios Lab</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Wed, 21 Oct 2026 00:02:00 +0000</lastBuildDate><atom:link href="https://lab.artur-rios.tech/tags/open-closed-principle/index.xml" rel="self" type="application/rss+xml"/><item><title>What Is the Open-Closed Principle? Extension, Abstraction, Plug-ins and the Expression Problem</title><link>https://lab.artur-rios.tech/concepts/open-closed-principle/</link><pubDate>Wed, 21 Oct 2026 00:02:00 +0000</pubDate><guid>https://lab.artur-rios.tech/concepts/open-closed-principle/</guid><description>&lt;p&gt;A shop adds a new way to ship parcels. In one codebase that means opening the&#10;function that prices shipping, adding a branch to the middle of it, and&#10;re-testing everything that calls it. In another it means writing one new class&#10;in one new file, and nothing that already works is touched. The difference&#10;between the two is what the &lt;strong&gt;open-closed principle&lt;/strong&gt; is about: arranging code&#10;so that new behaviour arrives as new code, rather than as edits to code that is&#10;released, tested and depended on. It is the second of the five SOLID principles,&#10;and this is part 2 of a series on them, after&#10;&lt;a href="../single-responsibility-principle/"&gt;the single responsibility principle&lt;/a&gt;.&#10;This article explains what the principle means, where it came from, what it&#10;looks like in running code, why no module can be closed against every change,&#10;how the expression problem sets its limits, and when the abstraction it calls&#10;for is worth paying for. Every output shown here was produced by running the&#10;code on Windows 11, with Python 3.14.6, not written by hand.&lt;/p&gt;</description></item></channel></rss>