<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://wiki.devilplan.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://wiki.devilplan.com/feed.php">
        <title>Luci4 Wiki Blog - blog:tech</title>
        <description></description>
        <link>https://wiki.devilplan.com/</link>
        <image rdf:resource="https://wiki.devilplan.com/_media/wiki:logo.png" />
       <dc:date>2026-04-05T12:10:40+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://wiki.devilplan.com/blog:tech:solid_unix"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://wiki.devilplan.com/_media/wiki:logo.png">
        <title>Luci4 Wiki Blog</title>
        <link>https://wiki.devilplan.com/</link>
        <url>https://wiki.devilplan.com/_media/wiki:logo.png</url>
    </image>
    <item rdf:about="https://wiki.devilplan.com/blog:tech:solid_unix">
        <dc:format>text/html</dc:format>
        <dc:date>2025-06-17T17:39:19+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>solid_unix</title>
        <link>https://wiki.devilplan.com/blog:tech:solid_unix</link>
        <description>


&lt;h1 class=&quot;sectionedit1&quot; id=&quot;solid_clean_architecture_unix_philosophy&quot;&gt;❖ SOLID, Clean Architecture &amp;amp; Unix philosophy&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;https://wiki.devilplan.com/_detail/blog:tech:ddog-chess.jpg?id=blog%3Atech%3Asolid_unix&quot; class=&quot;media&quot; title=&quot;blog:tech:ddog-chess.jpg&quot;&gt;&lt;img src=&quot;https://wiki.devilplan.com/_media/blog:tech:ddog-chess.jpg?w=400&amp;amp;tok=0967e8&quot; class=&quot;mediaright&quot; align=&quot;right&quot; loading=&quot;lazy&quot; alt=&quot;&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
As software systems grow more complex, it&amp;#039;s easy for code to become tangled, with classes that do too much, logic that&amp;#039;s hard to reuse, and changes in one place breaking unrelated parts of the app. To combat this, developers lean on design principles, &lt;strong&gt;guidelines that help us write clean, modular, and maintainable code&lt;/strong&gt;.
One of the most influential sets of principles in modern software engineering is known as &lt;code&gt;&amp;#039;SOLID&lt;/code&gt;&amp;#039;.
SOLID outlines five key rules for object-oriented design. But even beyond OOP, these principles help teams write better code , whether you&amp;#039;re building a mobile app, scripting in shell, or designing a backend service.
&lt;/p&gt;

&lt;p&gt;
Understanding SOLID means understanding how to &lt;strong&gt;break software into well-defined, independent parts&lt;/strong&gt; — so each part is easier to change, extend, and reason about.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u2756 SOLID, Clean Architecture &amp;amp; Unix philosophy&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;solid_clean_architecture_unix_philosophy&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;11-923&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit2&quot; id=&quot;this_article_contains_3_separate_parts&quot;&gt;This article contains 3 separate parts:&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;/div&gt;

&lt;h4 id=&quot;does_unix_follow_solid_principles&quot;&gt;- Does Unix follow SOLID principles?&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;/div&gt;

&lt;h4 id=&quot;when_does_a_system_become_large_enough_to_require_separation_of_responsibilities&quot;&gt;- When does a system become large enough to require separation of responsibilities?&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;

&lt;/div&gt;

&lt;h4 id=&quot;when_does_it_start_making_sense_to_introduce_clean_architecture_into_a_project&quot;&gt;- When does it start making sense to introduce Clean Architecture into a project?&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;This article contains 3 separate parts:&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;this_article_contains_3_separate_parts&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;924-1206&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit3&quot; id=&quot;does_unix_follow_solid_principles1&quot;&gt;Does Unix follow SOLID principles?&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
Not &lt;strong&gt;literally&lt;/strong&gt;, the SOLID principles were coined for object-oriented programming by &lt;strong&gt;Robert C. Martin (Uncle Bob)&lt;/strong&gt;. Unix, on the other hand, is rooted in &lt;strong&gt;process-based&lt;/strong&gt; design, with utilities built primarily in &lt;strong&gt;C and shell scripts&lt;/strong&gt;, not classes and objects.
&lt;/p&gt;

&lt;p&gt;
But &lt;strong&gt;philosophically&lt;/strong&gt;, Unix aligns with many of the same ideas, especially the most important one: &lt;strong&gt;Single Responsibility Principle (SRP)&lt;/strong&gt;.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;What is SOLID? Why it Matters&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;SOLID&lt;/strong&gt; is an acronym for five design principles that aim to make software easier to understand, maintain, and extend.
&lt;/p&gt;
&lt;div class=&quot;table sectionedit4&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Principle &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;S&lt;/strong&gt;ingle Responsibility &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; A class should have only one reason to change &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;O&lt;/strong&gt;pen/Closed &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Software should be open for extension, but closed for modification &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;L&lt;/strong&gt;iskov Substitution &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Subtypes must be substitutable for their base types &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;I&lt;/strong&gt;nterface Segregation &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Prefer many small, specific interfaces over large, general ones &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;D&lt;/strong&gt;ependency Inversion &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Depend on abstractions, not concrete implementations &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;1831-2287&amp;quot;} --&gt;
&lt;p&gt;
These principles are key in OOP and Clean Architecture — but they also echo Unix&amp;#039;s composable, minimalist philosophy.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Does Unix follow SOLID principles?&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;does_unix_follow_solid_principles1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1207-2414&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit5&quot; id=&quot;s_-_single_responsibility_principle&quot;&gt;S - Single Responsibility Principle&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;S - Single Responsibility Principle&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;s_-_single_responsibility_principle&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;2415-2463&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;in_oop&quot;&gt;In OOP:&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
A class should have one, and only one, reason to change.&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;
It means every class (or function, or module) should do &lt;strong&gt;one thing well&lt;/strong&gt;. If it has multiple responsibilities, it will be harder to maintain and more prone to bugs.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;In OOP:&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;in_oop&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;2464-2710&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit7&quot; id=&quot;in_unix&quot;&gt;In Unix:&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Each command-line utility is designed to do &lt;strong&gt;one job&lt;/strong&gt; and do it well.
&lt;/p&gt;

&lt;p&gt;
Examples:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;grep&lt;/code&gt; - filters lines that match a pattern&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;cut&lt;/code&gt; - extracts specific columns or fields&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;sort&lt;/code&gt; - sorts lines in a file or stream&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
These tools are intentionally small and &lt;strong&gt;composable&lt;/strong&gt;. You &lt;strong&gt;combine&lt;/strong&gt; them using pipes (&lt;code&gt;|&lt;/code&gt;) to build complex behaviors.
&lt;/p&gt;

&lt;p&gt;
Example:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;cat access.log | grep 404 | cut -d&amp;#039; &amp;#039; -f1 | sort | uniq -c | sort -nr&lt;/pre&gt;

&lt;p&gt;
Each tool:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Does one thing&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Can be updated independently&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Has a clear reason to change&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
That’s SRP — just not in class-based code, but in &lt;strong&gt;process-based design&lt;/strong&gt;.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;In Unix:&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;in_unix&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;2711-3345&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit8&quot; id=&quot;other_solid_principles_in_unix&quot;&gt;Other SOLID principles in Unix&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;table sectionedit9&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Principle &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Unix Alignment &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;S&lt;/strong&gt;ingle Responsibility &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ✅ Strong: each tool has a narrow purpose &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;O&lt;/strong&gt;pen/Closed &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 🟡 Somewhat: tools are extended through scripting, not internal modification &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;L&lt;/strong&gt;iskov Substitution &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ❌ Not really applicable — inheritance isn’t used &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;I&lt;/strong&gt;nterface Segregation &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ✅ Strong: tools use minimal, focused inputs/outputs (text streams, args) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;D&lt;/strong&gt;ependency Inversion &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 🟡 Weak: tools call each other via scripts but lack abstraction mechanisms &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table1&amp;quot;,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;3390-3896&amp;quot;} --&gt;&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
Unix doesn&amp;#039;t enforce these principles through classes — but its *culture* encourages similar separation of concerns.&lt;/div&gt;&lt;/blockquote&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Other SOLID principles in Unix&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;other_solid_principles_in_unix&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;3346-4025&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit10&quot; id=&quot;srp_in_android_app_architecture&quot;&gt;SRP in Android App Architecture&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
SRP isn’t just for classes. In an Android app (especially with Clean Architecture), SRP applies to:
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;SRP in Android App Architecture&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;srp_in_android_app_architecture&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:10,&amp;quot;range&amp;quot;:&amp;quot;4026-4173&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit11&quot; id=&quot;layers&quot;&gt;Layers&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;Presentation layer&lt;/code&gt;: handles UI state only&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;Domain layer&lt;/code&gt;: handles business logic&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;Data layer&lt;/code&gt;: handles data access&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Layers&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;layers&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:11,&amp;quot;range&amp;quot;:&amp;quot;4174-4327&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit12&quot; id=&quot;components&quot;&gt;Components&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;ViewModel&lt;/code&gt;: handles user interactions and state&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;UseCase&lt;/code&gt;: handles one specific business operation (e.g., &lt;code&gt;GetUserPosts&lt;/code&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;code&gt;Repository&lt;/code&gt;: abstracts data source access (e.g., DB, network)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
If a component does &lt;em&gt;too many things&lt;/em&gt; — UI + business logic + data access — it becomes hard to test, understand, or change.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Components&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;components&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:12,&amp;quot;range&amp;quot;:&amp;quot;4328-4683&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit13&quot; id=&quot;srp_examples&quot;&gt;SRP Examples&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;div class=&quot;table sectionedit14&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Component &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Responsibility &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;LoginViewModel&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Manage login UI state and events &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;LoginUseCase&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Handle login logic and validation &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;UserRepo&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Fetch and cache user data (from DB or &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt;) &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table2&amp;quot;,&amp;quot;secid&amp;quot;:14,&amp;quot;range&amp;quot;:&amp;quot;4708-4909&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;SRP Examples&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;srp_examples&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:13,&amp;quot;range&amp;quot;:&amp;quot;4684-4910&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit15&quot; id=&quot;analogysrp_in_unix_vs_android&quot;&gt;Analogy: SRP in Unix vs Android&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;table sectionedit16&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Aspect &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Unix Utility &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; Android Component &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; One Concern &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;code&gt;cut&lt;/code&gt; extracts fields &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;code&gt;LoginUseCase&lt;/code&gt; handles login only &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Composability &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Combine via pipes (&lt;code&gt;|&lt;/code&gt;) &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Combine via layers (domain/UI) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Reason to Change &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;code&gt;grep&lt;/code&gt; only changes if filtering changes &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; &lt;code&gt;UserRepo&lt;/code&gt; changes only if data layer changes &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table3&amp;quot;,&amp;quot;secid&amp;quot;:16,&amp;quot;range&amp;quot;:&amp;quot;4956-5266&amp;quot;} --&gt;
&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Analogy: SRP in Unix vs Android&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;analogysrp_in_unix_vs_android&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:15,&amp;quot;range&amp;quot;:&amp;quot;4911-5267&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit17&quot; id=&quot;visual_diagramunix_shell_pipeline_vs_android_architecture&quot;&gt;Visual Diagram: Unix Shell Pipeline vs Android Architecture&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Here’s a conceptual side-by-side comparison:
&lt;/p&gt;
&lt;div class=&quot;table sectionedit18&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Unix Shell Pipeline &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Android Architecture Flow &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;cat file.txt&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Repository provides raw data &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;grep error&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; UseCase filters meaningful business data &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;cut -d&amp;#039; &amp;#039; -f1&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ViewModel extracts/display-relevant state &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;code&gt;sort | uniq -c&lt;/code&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; UI Layer formats and displays info &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table4&amp;quot;,&amp;quot;secid&amp;quot;:18,&amp;quot;range&amp;quot;:&amp;quot;5389-5672&amp;quot;} --&gt;
&lt;p&gt;
Both systems:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Break problems into small, testable steps&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Compose functionality through clearly defined boundaries&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Emphasize separation of concerns&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Visual Diagram: Unix Shell Pipeline vs Android Architecture&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;visual_diagramunix_shell_pipeline_vs_android_architecture&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:17,&amp;quot;range&amp;quot;:&amp;quot;5268-5837&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit19&quot; id=&quot;interpreting_open_closed_and_dependency_inversion_in_unix&quot;&gt;Interpreting Open/Closed and Dependency Inversion in Unix&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Interpreting Open\/Closed and Dependency Inversion in Unix&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;interpreting_open_closed_and_dependency_inversion_in_unix&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:19,&amp;quot;range&amp;quot;:&amp;quot;5838-5909&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit20&quot; id=&quot;open_closed_principle_ocp_in_unix&quot;&gt;Open/Closed Principle (OCP) in Unix&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
&amp;quot;Software entities should be open for extension but closed for modification.&amp;quot;&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;
How Unix achieves this:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; You &lt;code&gt;&amp;#039;extend&lt;/code&gt;&amp;#039; commands by combining them in scripts&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; You &lt;code&gt;&amp;#039;wrap&lt;/code&gt;&amp;#039; commands with functions or aliases (without changing internal code)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Environment variables (e.g., &lt;code&gt;$PAGER&lt;/code&gt;, &lt;code&gt;$EDITOR&lt;/code&gt;) let programs integrate external tools&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Example:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
mygrep() {
  grep --color=auto &amp;quot;$@&amp;quot; | less
}&lt;/pre&gt;

&lt;p&gt;
The &lt;code&gt;grep&lt;/code&gt; command wasn’t modified — it was extended.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Open\/Closed Principle (OCP) in Unix&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;open_closed_principle_ocp_in_unix&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:20,&amp;quot;range&amp;quot;:&amp;quot;5910-6422&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit21&quot; id=&quot;dependency_inversion_principle_dip_in_unix&quot;&gt;Dependency Inversion Principle (DIP) in Unix&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
&amp;quot;High-level modules should not depend on low-level modules. Both should depend on abstractions.&amp;quot;&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;
Unix tools don&amp;#039;t have formal abstractions (like interfaces or abstract classes), but:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;They rely on &lt;strong&gt;text streams&lt;/strong&gt; — a form of implicit interface&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You can &lt;strong&gt;swap tools&lt;/strong&gt; if they follow common conventions (e.g., replacing &lt;code&gt;less&lt;/code&gt; with &lt;code&gt;more&lt;/code&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You can script &lt;strong&gt;plug-in architectures&lt;/strong&gt; with exec calls or sourcing shell functions dynamically&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Example:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
if [ -x ./mybackend ]; then
  ./mybackend &amp;quot;$@&amp;quot;
else
  default_backend &amp;quot;$@&amp;quot;
fi&lt;/pre&gt;

&lt;p&gt;
This allows swappable implementations — an inversion of control.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Dependency Inversion Principle (DIP) in Unix&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;dependency_inversion_principle_dip_in_unix&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:21,&amp;quot;range&amp;quot;:&amp;quot;6423-7096&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit22&quot; id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Unix &lt;strong&gt;strongly embodies SRP&lt;/strong&gt;: each tool does one thing.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Other SOLID principles (especially Interface Segregation and Open/Closed) show up in Unix behavior, if not structure.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Whether in pipes or layers, the key is &lt;strong&gt;small, composable, testable units&lt;/strong&gt; that reduce coupling and increase maintainability.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Summary&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;summary&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:22,&amp;quot;range&amp;quot;:&amp;quot;7097-7438&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit23&quot; id=&quot;when_does_a_system_become_large_enough_to_require_separation_of_responsibilities1&quot;&gt;When does a system become large enough to require separation of responsibilities?&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
This is one of the &lt;strong&gt;hardest and most important questions&lt;/strong&gt; in applying the Single Responsibility Principle (SRP) well.
There’s no universal line, it’s a &lt;strong&gt;judgment call&lt;/strong&gt;, but there are practical guidelines and heuristics to help you decide &lt;strong&gt;when&lt;/strong&gt; a piece of code needs to be split due to too many responsibilities.
&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
Don’t split prematurely, SRP is about clarity and safety, not bureaucracy.&lt;/div&gt;&lt;/blockquote&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;When does a system become large enough to require separation of responsibilities?&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;when_does_a_system_become_large_enough_to_require_separation_of_responsibilities1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:23,&amp;quot;range&amp;quot;:&amp;quot;7439-7928&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit24&quot; id=&quot;understanding_responsibility&quot;&gt;Understanding Responsibility&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
A &lt;em&gt;responsibility&lt;/em&gt; is a &lt;strong&gt;reason to change&lt;/strong&gt;, not just a “thing it does.”
&lt;/p&gt;
&lt;blockquote&gt;&lt;div class=&quot;no&quot;&gt;
**Robert C. Martin (Uncle Bob):**“A responsibility is a reason to change.”&lt;/div&gt;&lt;/blockquote&gt;

&lt;p&gt;
So the key test is:
&lt;strong&gt;If a change request comes in, which part of this component will it affect?&lt;/strong&gt;
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Understanding Responsibility&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;understanding_responsibility&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:24,&amp;quot;range&amp;quot;:&amp;quot;7929-8227&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit25&quot; id=&quot;🧭_guiding_principles_to_decide_when_to_split&quot;&gt;🧭 Guiding Principles to Decide When to Split&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\ud83e\udded Guiding Principles to Decide When to Split&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\ud83e\udded_guiding_principles_to_decide_when_to_split&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:25,&amp;quot;range&amp;quot;:&amp;quot;8228-8279&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit26&quot; id=&quot;❗_you_re_changing_for_more_than_one_reason&quot;&gt;1. ❗ You’re Changing for More Than One Reason&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;strong&gt;Signal&lt;/strong&gt;: If two or more distinct types of changes would require touching the same file/class/module.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Examples&lt;/strong&gt;:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You need to change a UI layout and also fix a bug in database syncing — and both require touching the same class? Split it.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;1. \u2757 You\u2019re Changing for More Than One Reason&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u2757_you_re_changing_for_more_than_one_reason&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:26,&amp;quot;range&amp;quot;:&amp;quot;8280-8584&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit27&quot; id=&quot;🧪_it_s_hard_to_unit_test&quot;&gt;2. 🧪 It&amp;#039;s Hard to Unit Test&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
If you&amp;#039;re struggling to write a small, focused unit test, the class probably does too much.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Heuristic&lt;/strong&gt;:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;If you must mock too many unrelated dependencies to test a method, that method may not have a single responsibility.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;2. \ud83e\uddea It&amp;#039;s Hard to Unit Test&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\ud83e\uddea_it_s_hard_to_unit_test&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:27,&amp;quot;range&amp;quot;:&amp;quot;8585-8850&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit28&quot; id=&quot;it_uses_unrelated_domains&quot;&gt;3. It Uses Unrelated Domains&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
&lt;strong&gt;Signal&lt;/strong&gt;: The class uses concepts from more than one domain.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;Android example&lt;/strong&gt;:
&lt;/p&gt;
&lt;dl class=&quot;file&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;https://wiki.devilplan.com/_export/code/blog:tech:solid_unix?codeblock=2&quot; title=&quot;Download Snippet&quot; class=&quot;mediafile mf_kotlin&quot;&gt;snippet.kotlin&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code file kotlin&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;class&lt;/span&gt; UserProfileManager &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fun&lt;/span&gt; drawUI&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; ... &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fun&lt;/span&gt; fetchFromServer&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; ... &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;fun&lt;/span&gt; saveToDatabase&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt; ... &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;
This class:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;knows how to &lt;strong&gt;draw&lt;/strong&gt;,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;talks to &lt;strong&gt;network&lt;/strong&gt;,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;and stores to &lt;strong&gt;local DB&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
These are 3 separate domains → split it.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;3. It Uses Unrelated Domains&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;it_uses_unrelated_domains&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:28,&amp;quot;range&amp;quot;:&amp;quot;8851-9244&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit29&quot; id=&quot;🔁_you_keep_coming_back_to_it_for_unrelated_fixes&quot;&gt;4. 🔁 You Keep Coming Back to It for Unrelated Fixes&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
When one class keeps being involved in a wide variety of issues or changes — it&amp;#039;s a red flag.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;4. \ud83d\udd01 You Keep Coming Back to It for Unrelated Fixes&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\ud83d\udd01_you_keep_coming_back_to_it_for_unrelated_fixes&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:29,&amp;quot;range&amp;quot;:&amp;quot;9245-9402&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit30&quot; id=&quot;cognitive_load_lines_of_code_is_a_symptom_not_a_cause&quot;&gt;5. Cognitive Load (Lines of Code is a symptom, not a cause)&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
There’s no magic LOC number, but if:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You can&amp;#039;t explain what a class does in &lt;strong&gt;one sentence&lt;/strong&gt;,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Or a function needs &lt;strong&gt;multiple scrolls&lt;/strong&gt; to read through,&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
…it likely violates SRP.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;5. Cognitive Load (Lines of Code is a symptom, not a cause)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;cognitive_load_lines_of_code_is_a_symptom_not_a_cause&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:30,&amp;quot;range&amp;quot;:&amp;quot;9403-9660&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit31&quot; id=&quot;scaling_thresholds_for_separation&quot;&gt;Scaling Thresholds for Separation&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;table sectionedit32&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Project Size &lt;/th&gt;&lt;th class=&quot;col1 leftalign&quot;&gt; SRP Enforcement Strategy     &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;strong&gt;Small scripts / proof-of-concepts&lt;/strong&gt; &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Don&amp;#039;t over-engineer. A bit of mess is fine.                  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;strong&gt;Single-developer apps&lt;/strong&gt;             &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Start separating when logic becomes harder to reuse or test. &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;strong&gt;Growing teams or production apps&lt;/strong&gt;  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Enforce SRP early. Clean separation avoids tech debt.        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &lt;strong&gt;Large codebases&lt;/strong&gt;                   &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; SRP is mandatory — otherwise, changes become dangerous.      &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table5&amp;quot;,&amp;quot;secid&amp;quot;:32,&amp;quot;range&amp;quot;:&amp;quot;9700-10169&amp;quot;} --&gt;&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Scaling Thresholds for Separation&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;scaling_thresholds_for_separation&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:31,&amp;quot;range&amp;quot;:&amp;quot;9661-10175&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit33&quot; id=&quot;summary1&quot;&gt;Summary&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;strong&gt;Split when:&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You have more than one reason to change,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Code spans multiple unrelated concerns,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Testing becomes awkward,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Changes become risky or confusing.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Summary&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;summary1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:33,&amp;quot;range&amp;quot;:&amp;quot;10176-10374&amp;quot;} --&gt;
&lt;h1 class=&quot;sectionedit34&quot; id=&quot;when_does_it_start_making_sense_to_introduce_clean_architecture_into_a_project1&quot;&gt;When does it start making sense to introduce Clean Architecture into a project?&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
That’s a &lt;strong&gt;deep&lt;/strong&gt; and important question, and the answer depends on balancing &lt;strong&gt;project scope, risk, and maintenance horizon&lt;/strong&gt;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;When does it start making sense to introduce Clean Architecture into a project?&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;when_does_it_start_making_sense_to_introduce_clean_architecture_into_a_project1&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:34,&amp;quot;range&amp;quot;:&amp;quot;10375-10589&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit35&quot; id=&quot;minimum_scale_where_clean_architecture_becomes_worthwhile&quot;&gt;Minimum Scale Where Clean Architecture Becomes Worthwhile&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;strong&gt;My minimum&lt;/strong&gt;:
For a solo developer or small team, I’d adopt &lt;strong&gt;Clean Architecture principles&lt;/strong&gt; (modular layers, separation of concerns, testability) as soon as:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;The app has &lt;strong&gt;multiple distinct business rules&lt;/strong&gt;, &lt;strong&gt;user flows&lt;/strong&gt;, or &lt;strong&gt;data sources&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;It’s &lt;strong&gt;expected to evolve&lt;/strong&gt; or be &lt;strong&gt;maintained&lt;/strong&gt; for months or more.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;There’s a need for &lt;strong&gt;testing logic&lt;/strong&gt; independently of the UI or Android framework.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
That threshold can be surprisingly &lt;strong&gt;low&lt;/strong&gt; — for example:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;An Android podcast player with downloads, metadata fetching, playback, favorites&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;A task manager with offline sync and reminders&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;A health tracking app with charts and history&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
If your app:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Has more than one &lt;strong&gt;core feature&lt;/strong&gt;,&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Or touches more than one &lt;strong&gt;domain&lt;/strong&gt; (UI, DB, network),&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Or is &lt;strong&gt;not trivial to unit test&lt;/strong&gt; as-is…&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
…then going with a &lt;strong&gt;modular layered approach&lt;/strong&gt; like Clean Architecture pays off early.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Minimum Scale Where Clean Architecture Becomes Worthwhile&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;minimum_scale_where_clean_architecture_becomes_worthwhile&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:35,&amp;quot;range&amp;quot;:&amp;quot;10590-11561&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit36&quot; id=&quot;when_clean_architecture_is_overkill&quot;&gt;When Clean Architecture Is Overkill&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Clean Architecture is &lt;strong&gt;not needed&lt;/strong&gt; (and can actively slow you down) if:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You’re building a &lt;strong&gt;throwaway prototype&lt;/strong&gt; or MVP.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;The app has &lt;strong&gt;one screen&lt;/strong&gt;, &lt;strong&gt;one user flow&lt;/strong&gt;, or &lt;strong&gt;just UI + local data&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You’re &lt;strong&gt;solo&lt;/strong&gt;, and need to ship fast, with low future change risk.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Example:
A flashlight app, a simple calculator, a QR scanner, you can write these with just an Activity and a couple helper classes. No need for &lt;code&gt;UseCases&lt;/code&gt;, &lt;code&gt;Repositories&lt;/code&gt;, &lt;code&gt;DataSources&lt;/code&gt;, etc.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;When Clean Architecture Is Overkill&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;when_clean_architecture_is_overkill&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:36,&amp;quot;range&amp;quot;:&amp;quot;11562-12081&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit37&quot; id=&quot;heuristics_to_decide&quot;&gt;Heuristics to Decide&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;table sectionedit38&quot;&gt;&lt;table class=&quot;inline&quot;&gt;
	&lt;thead&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; If you have… &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Consider &lt;/th&gt;
	&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; &amp;gt;1 data source (e.g., DB + &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt;)    &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; ✅ Use layers (&lt;code&gt;repository&lt;/code&gt;, &lt;code&gt;datasource&lt;/code&gt;)              &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Business logic that must be tested &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; ✅ Use &lt;code&gt;usecases&lt;/code&gt; or &lt;code&gt;interactors&lt;/code&gt;                      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; Multiple devs / long-term codebase &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; ✅ Clean separation helps scale teamwork                &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Tight deadline + short-lived MVP   &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; ❌ Keep it flat, maybe refactor later                   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Simple CRUD with no complex logic  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; ❌ Stick to &lt;code&gt;MVVM&lt;/code&gt; or even plain &lt;code&gt;Activity + ViewModel&lt;/code&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; External SDKs or unstable APIs     &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; ✅ Use abstractions to decouple                         &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;table&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;table6&amp;quot;,&amp;quot;secid&amp;quot;:38,&amp;quot;range&amp;quot;:&amp;quot;12108-12725&amp;quot;} --&gt;&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Heuristics to Decide&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;heuristics_to_decide&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:37,&amp;quot;range&amp;quot;:&amp;quot;12082-12730&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit39&quot; id=&quot;evolution_strategy_start_simple_grow_into_clean&quot;&gt;Evolution Strategy (Start Simple → Grow into Clean)&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
You don’t need to go full Clean from day one.
&lt;/p&gt;

&lt;p&gt;
Here’s a path:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;&lt;strong&gt;Start flat&lt;/strong&gt; with clear separation: UI → ViewModel → Repo → Network/DB.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level0&quot;&gt;&lt;div class=&quot;li&quot;&gt;As logic grows, extract &lt;code&gt;UseCases&lt;/code&gt; to isolate operations.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level0&quot;&gt;&lt;div class=&quot;li&quot;&gt;If the app keeps growing, split into &lt;code&gt;domain&lt;/code&gt;, &lt;code&gt;data&lt;/code&gt;, and &lt;code&gt;presentation&lt;/code&gt; modules.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level0&quot;&gt;&lt;div class=&quot;li&quot;&gt;Add interfaces and DI (like Hilt/Koin) to fully decouple and test.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
This is sometimes called &lt;strong&gt;“clean-lite”&lt;/strong&gt; or &lt;strong&gt;“onion-by-need”&lt;/strong&gt;.
&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Evolution Strategy (Start Simple \u2192 Grow into Clean)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;evolution_strategy_start_simple_grow_into_clean&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:39,&amp;quot;range&amp;quot;:&amp;quot;12731-13232&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit40&quot; id=&quot;summary2&quot;&gt;Summary&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;Summary&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;summary2&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:40,&amp;quot;range&amp;quot;:&amp;quot;13233-13244&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit41&quot; id=&quot;you_should_adopt_clean_architecture_if&quot;&gt;You should adopt Clean Architecture if:&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;The app has &lt;strong&gt;nontrivial logic&lt;/strong&gt;, &lt;strong&gt;multiple domains&lt;/strong&gt;, or &lt;strong&gt;business rules&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You plan to &lt;strong&gt;maintain/test/grow&lt;/strong&gt; it seriously.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You want a &lt;strong&gt;clear separation of concerns&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;You should adopt Clean Architecture if:&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;you_should_adopt_clean_architecture_if&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:41,&amp;quot;range&amp;quot;:&amp;quot;13245-13469&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit42&quot; id=&quot;you_shouldn_t_go_full_clean_if&quot;&gt;You shouldn’t go full Clean if:&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;It’s &lt;strong&gt;just UI + a bit of state&lt;/strong&gt;.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;You&amp;#039;re prototyping.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt;Overhead will slow you more than help.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;dl class=&quot;file&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;https://wiki.devilplan.com/_export/code/blog:tech:solid_unix?codeblock=3&quot; title=&quot;Download Snippet&quot; class=&quot;mediafile mf_cpp&quot;&gt;snippet.cpp&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code file cpp&quot;&gt;by&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt;
▖     ▘▖▖
▌ ▌▌▛▘▌▙▌
▙▖▙▌▙▖▌ ▌
&amp;nbsp;
published&lt;span class=&quot;sy4&quot;&gt;:&lt;/span&gt; June &lt;span class=&quot;nu0&quot;&gt;16&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2025&lt;/span&gt;.&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;You shouldn\u2019t go full Clean if:&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;you_shouldn_t_go_full_clean_if&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:42,&amp;quot;range&amp;quot;:&amp;quot;13470-&amp;quot;} --&gt;</description>
    </item>
</rdf:RDF>
