<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Pieter Groenendijk</title>
    <description>The latest articles on DEV Community by Pieter Groenendijk (@pietergroenendijk).</description>
    <link>https://dev.to/pietergroenendijk</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2829979%2F091af269-3931-40ca-a1d7-20fba7c83fe9.jpeg</url>
      <title>DEV Community: Pieter Groenendijk</title>
      <link>https://dev.to/pietergroenendijk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pietergroenendijk"/>
    <language>en</language>
    <item>
      <title>Composition over inheritance, and Go's approach</title>
      <dc:creator>Pieter Groenendijk</dc:creator>
      <pubDate>Mon, 15 Dec 2025 13:46:00 +0000</pubDate>
      <link>https://dev.to/pietergroenendijk/composition-over-inheritance-and-gos-approach-427m</link>
      <guid>https://dev.to/pietergroenendijk/composition-over-inheritance-and-gos-approach-427m</guid>
      <description>&lt;h2&gt;
  
  
  Preface
&lt;/h2&gt;

&lt;p&gt;I estimate that you only need a basic understanding of Go to be able to read almost all Go code. The compiler is highly opinionated, and holds you accountable for any shenanigans. Forcing you to write consistent and simple code; almost no style deviations, and almost no syntax sugar. Short term convenience is traded in for long-term clarity and reliability, as seen here:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"container/list"&lt;/span&gt; &lt;span class="c"&gt;// ERROR: Import not used — we don't do retours...&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;err&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;wrongStuff&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="c"&gt;// ERROR: You gotta face your errors man...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;crazyFunc&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="c"&gt;// ERROR: That curly brace should not be there...&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c"&gt;// ERROR: Does not seem like that "else" is connected well...&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s"&gt;"helloWorld"&lt;/span&gt; &lt;span class="c"&gt;// ERROR: No implicit type conversions, show me that you mean it...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;wrongStuff&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;error&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;errors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;New&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"I did some wrong stuff, whoopsie"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;"An idiot admires complexity; a genius admires simplicity"&lt;br&gt;
~ Terry A. Davis&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For me, above example is a symptom of the principled programming Go wants you to do, and shows superficially why I love Go. Yet, I speculate that some principles may be more difficult to derive from just writing code, not knowing their deeper design motivations. I likely write code unfit for Go — code in Go, just not Go code. &lt;/p&gt;

&lt;p&gt;As a consequence, these pitfalls emerge, things I repeatedly try to solve a certain way, even though it's hurting me more than it's benefiting me. I want to research these pitfalls one by one, adapting &lt;br&gt;
to the &lt;em&gt;go mindset&lt;/em&gt; where sensible. My hope is that this analysis can also be used by other software engineers to learn alongside me. It's time to challenge the underlying assumptions and break open those learned [N]-oriented, -driven, or -based development methodologies.&lt;/p&gt;
&lt;h2&gt;
  
  
  What's inheritance?
&lt;/h2&gt;

&lt;p&gt;Tougher to answer than you might think. For the same reason why the Java keyword likely is "extends", and not "inherits". At the same time, if you look up "Java extends keyword", you'll find: "The extends keyword in Java is used to indicate that a class inherits from a superclass".&lt;/p&gt;

&lt;p&gt;Let's try — there are two concepts to differentiate, namely subtyping, and inheritance. &lt;/p&gt;

&lt;p&gt;Subtyping refers to compatibility of interfaces. Type &lt;code&gt;B&lt;/code&gt; is a subtype of &lt;code&gt;A&lt;/code&gt; if every function that can be invoked on an object of type &lt;code&gt;A&lt;/code&gt; can also be invoked on an object of type &lt;code&gt;B&lt;/code&gt;. Therefore in practice, allowing substitution.&lt;/p&gt;

&lt;p&gt;Inheritance refers to reuse of implementations. Type &lt;code&gt;B&lt;/code&gt; inherits from another type &lt;code&gt;A&lt;/code&gt; if some functions for &lt;code&gt;B&lt;/code&gt; are written in terms of functions of &lt;code&gt;A&lt;/code&gt;. Therefore in practice, allowing code reuse.&lt;/p&gt;

&lt;p&gt;Noteworthy, &lt;code&gt;A&lt;/code&gt; being a subtype of &lt;code&gt;B&lt;/code&gt; does in fact not have to mean &lt;code&gt;A&lt;/code&gt; also inherits from &lt;code&gt;B&lt;/code&gt;, or the other way around; they're independent relationships. Yet in practice, many languages couple &lt;br&gt;
these concepts anyways, forming subclassing. &lt;/p&gt;

&lt;p&gt;Take the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Animal {
    sleep() { ... }

    poop() { ... }
}

Dog subclasses Animal {
    happy360() {
        // spinning around
        poop()
    }
}

singToSleep(Animal animal) {
    // singing oh so graciously
    animal.sleep()
}

Dog dog = new Dog();
dog.happy360();
singToSleep(dog);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the &lt;code&gt;Dog&lt;/code&gt; class subclasses the &lt;code&gt;Animal&lt;/code&gt; class. The &lt;code&gt;Dog&lt;/code&gt; inherits the implementation from &lt;code&gt;Animal&lt;/code&gt;, but also subtypes &lt;code&gt;Animal&lt;/code&gt;. Respectively allowing me to reuse the &lt;code&gt;poop()&lt;/code&gt; implementation in &lt;code&gt;Dog&lt;/code&gt;, and to substitute an &lt;code&gt;Animal&lt;/code&gt; with a &lt;br&gt;
&lt;code&gt;Dog&lt;/code&gt; in &lt;code&gt;singToSleep()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3tiukct6qld94szfr5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3tiukct6qld94szfr5l.png" alt="Rough terminology of subclassing" width="800" height="880"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What's composition?
&lt;/h2&gt;

&lt;p&gt;Composition refers to the combining of types into more complex ones. Practically, meaning placing variables of their own type inside a type definition. A simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pet {
    play() { ... }
}

Person {
    Pet pet

    playWithPet() {
        ...
        pet.play()
        ...
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, &lt;code&gt;Person&lt;/code&gt; is composited of a &lt;code&gt;Pet&lt;/code&gt;. Allowing &lt;code&gt;pet.play()&lt;/code&gt; to be invoked inside &lt;code&gt;Person&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ckxkzolhekug2awgsxy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ckxkzolhekug2awgsxy.png" alt="Rough terminology, including composition" width="800" height="698"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Composition over inheritance
&lt;/h2&gt;

&lt;p&gt;The argument generally falls back onto the maintainability of the code.&lt;/p&gt;

&lt;p&gt;The specification of an object is not limited to it's signatures, but also includes the pre- and -post conditions. If a type's specification is consistent, then users of that type can have reliable expectations, if not, functionality may be unpredictable. &lt;br&gt;
The purpose of encapsulation is to create abstractions that keep a consistent specification. &lt;/p&gt;



&lt;p&gt;Yet in practice, subclassing does allow meddling with internal &lt;br&gt;
state, and I'm not just talking about Javascript (I propose we call "programming in Javascript" "meddling"). Moreso, many wide-spread design patterns are reliant on it. Let me show you with the following example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Worker {
    tasks string[]
    coffee Coffee

    doWorkDay() {
        prepare()
        prepareMore()
        work()
    }

    prepare() {
        // plan tasks
        tasks = {
            "meeting",
            "bug A",
            "bug B",
            "feature X",
        }
    }

    prepareMore() {
        // get coffee
        coffee = new Coffee()
    }

    work() {
        // work
        foreach task in tasks {
            // do task
        }
    }
}

ChaosWorker subclasses Worker {
    // time to meddle
    prepare() {
        // Not doing anything
    }
}

doWorkDay(workers Worker[]) {
    foreach worker in workers {
        worker.doWorkDay()
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By &lt;code&gt;ChaosWorker&lt;/code&gt; overriding the &lt;code&gt;prepare()&lt;/code&gt; method the &lt;code&gt;Worker&lt;/code&gt;'s specification has been sabotaged. The function &lt;code&gt;doWorkDay()&lt;/code&gt; asking for &lt;code&gt;Worker&lt;/code&gt;'s will fail for any given &lt;code&gt;ChaosWorker&lt;/code&gt; even though they can be freely substituted. From &lt;code&gt;doWorkDay()&lt;/code&gt;'s perspective the &lt;code&gt;Worker&lt;/code&gt;'s interface has remained consistent, but the specification has not.&lt;/p&gt;

&lt;p&gt;Using inheritance, one has to fully grasp the inner workings of &lt;code&gt;Worker&lt;/code&gt; to reuse code correctly. That is because each specialization of &lt;code&gt;Worker&lt;/code&gt; is not only coupled to the interface, but also the internal implementation. &lt;code&gt;Worker&lt;/code&gt; is not enforced to be used as a cohesive type. Any &lt;code&gt;Worker&lt;/code&gt; usage such as &lt;code&gt;goWorkDay()&lt;/code&gt; needs to worry about each given &lt;code&gt;Worker&lt;/code&gt;'s concrete implementation.&lt;/p&gt;

&lt;p&gt;Another example, showing how seemingly safe mutations to &lt;code&gt;Worker&lt;/code&gt; may cause the amalgamation to stop functioning. Imagine the following addition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DoubleWorker subclasses Worker {
    // Seems perfectly fine
    prepareMore() {
        prepare()
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This worker will now plan double the tasks, without any real benefit — sure. A dumb but innocent change.&lt;/p&gt;

&lt;p&gt;Now imagine we refactor our &lt;code&gt;Worker&lt;/code&gt;'s method &lt;code&gt;prepare()&lt;/code&gt; and &lt;code&gt;doWorkDay()&lt;/code&gt; as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;doWorkDay() {
    prepare()
    work()
}

prepare() {
    // plan tasks
    tasks = {
        "meeting",
        "bug A",
        "bug B",
        "feature X",
    }

    prepareMore()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another innocent change? From &lt;code&gt;Worker&lt;/code&gt;'s perspective the meaningful instructions &lt;code&gt;doWorkDay()&lt;/code&gt; should produce hasn't changed. Yet, you'll find the following call stack:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;doWorkDay()
    prepare()
        prepareMore()
            prepare()
                prepareMore()
                    prepare()
                        ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Infinite recursion due to the fact that &lt;code&gt;Worker&lt;/code&gt; doesn't specifically call &lt;code&gt;Worker&lt;/code&gt;'s version of &lt;code&gt;prepareMore()&lt;/code&gt;. The amalgamation of each implementation of &lt;code&gt;Worker&lt;/code&gt; and &lt;code&gt;Worker&lt;/code&gt; itself is treated as one cohesive whole; it's a package deal. You deal with a &lt;code&gt;Worker&lt;/code&gt;, you deal with every specialization of it.&lt;/p&gt;

&lt;p&gt;Practically when^[i.e. only basic access modifiers such as "public", "protected" and "private" are used.]:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;A&lt;/code&gt; subclasses &lt;code&gt;B&lt;/code&gt;, you get the type specifications: &lt;code&gt;AB&lt;/code&gt;. only the amalgamation is enforced to be consistent; the coupling is implementation-wide. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When &lt;code&gt;A&lt;/code&gt; is composed of &lt;code&gt;B&lt;/code&gt;, you get the type specifications: &lt;code&gt;A&lt;/code&gt; and &lt;code&gt;B&lt;/code&gt;. both specifications are enforced to be consistent independently; the coupling remains at the interface.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the while object-oriented programming advertises encapsulation as a core feature. The core design of many languages don't really&lt;br&gt;
stimulate using it correctly however. Of course, in Java the keyword &lt;code&gt;final&lt;/code&gt; can be freely used on classes and methods, disallowing subclassing and overriding respectively. But it needs to be explicitly declared — and I haven't seen any codebase doing this consistently. Reportedly, the Java inventor James Gosling himself has spoken against implementation inheritance, stating that he would not include it if he were to redesign Java.&lt;/p&gt;

&lt;p&gt;On the other side composition generally has better encapsulation enforcement out of the box, needing only the explicit access modifiers such as &lt;code&gt;public&lt;/code&gt; and &lt;code&gt;private&lt;/code&gt;. This leads to stronger encapsulation, and therefore lower coupling and higher cohesion can be more easily enforced. Abuse is still possible, just a lot harder.&lt;/p&gt;



&lt;p&gt;Code reuse will work simply as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Animal {
    public poop() { ... }
}

Dog {
    Animal animal

    public poop() { 
        animal.poop() 
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With composition we don't propagate the interface hoever, losing it's &lt;br&gt;
substitution capabilities. By introducing an interface, and a forwarding method we can achieve this explicitly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;interface Pooper {
    poop()
}

Animal implements Pooper {
    public poop() { ... }
}

Dog implements Pooper {
    Animal animal

    public poop() {
        animal.poop()
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7uo1hqsh43aggw83ow4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh7uo1hqsh43aggw83ow4.png" alt="Rough terminology, including interface subtyping (made up the term myself)" width="800" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Go's approach
&lt;/h2&gt;

&lt;p&gt;Go does not provide subclassing, just composition.&lt;/p&gt;

&lt;p&gt;It does provide embedding. Embedding builds on interface-inheritance &lt;br&gt;
and method-forwarding. It's functionally the same as previous example, just without the boilerplate. &lt;/p&gt;

&lt;p&gt;By inheriting the interface of the outer type, it can be substituted for that interface. Shown in the updated example below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Animal {
    public poop() { ... }
}

Dog {
    Animal // Embedding of Animal since only the type is provided (no name)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Dog&lt;/code&gt; embeds &lt;code&gt;Animal&lt;/code&gt;, thereby inheriting it's interface. Therefore &lt;code&gt;poop()&lt;/code&gt; can be directly called onto a &lt;code&gt;Dog&lt;/code&gt; instance. The implementation of &lt;code&gt;poop()&lt;/code&gt;, opposed to with subclassing, remains encapsulated in &lt;code&gt;Animal&lt;/code&gt;, limiting our coupling to the interface.&lt;/p&gt;

&lt;p&gt;We hereby have the writing convenience of subclassing, but the lower coupling and higher cohesion composition provides. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbaaug4ay3pmpwbwov9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdbaaug4ay3pmpwbwov9u.png" alt="Rough terminology, including embedding" width="800" height="795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Many languages provide subclassing, a heavily flawed coupling of inheriting both the interface as the implementation, creating amalgamations of high coupling and low cohesion, making maintainability that much harder. &lt;/p&gt;

&lt;p&gt;Composition provides the wanted low coupling and high cohesion, at the cost of verbosity. A tradeoff many consider worthy, fueling the "Composition over inheritance" perspective.&lt;/p&gt;

&lt;p&gt;Go is an example of a language which strictly enforces object code reuse through composition. With embedding the endeavor is not only possible but also highly pragmatic, solving the verbosity otherwise associated with composition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Weck, W., &amp;amp; Szyperski, C. (1998). Do We Need Inheritance. In Researchgate. &lt;a href="https://www.researchgate.net/publication/2297653_Do_We_Need_Inheritance" rel="noopener noreferrer"&gt;https://www.researchgate.net/publication/2297653_Do_We_Need_Inheritance&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025b, oktober 20). Composition over inheritance. Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Composition_over_inheritance" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Composition_over_inheritance&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agarwal, S. (2024, 9 november). Composition over inheritance in Golang. DEV Community. &lt;a href="https://dev.to/thesaltree/composition-over-inheritance-in-go-1261"&gt;https://dev.to/thesaltree/composition-over-inheritance-in-go-1261&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025c, november 20). Inheritance (object-oriented programming) - Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025b, oktober 16). Subtyping. Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Subtyping" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Subtyping&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Effective Go - the Go programming language. (z.d.). &lt;a href="https://go.dev/doc/effective_go" rel="noopener noreferrer"&gt;https://go.dev/doc/effective_go&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Writing Final Classes and Methods (The JavaTM Tutorials &amp;gt; Learning the Java Language &amp;gt; Interfaces and Inheritance). (z.d.). &lt;a href="https://docs.oracle.com/javase/tutorial/java/IandI/final.html" rel="noopener noreferrer"&gt;https://docs.oracle.com/javase/tutorial/java/IandI/final.html&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Agus, M. (2014, 11 mei). What is the difference between subtyping and inheritance in OO programming? Stack Overflow. &lt;a href="https://stackoverflow.com/questions/23592131/what-is-the-difference-between-subtyping-and-inheritance-in-oo-programming" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/23592131/what-is-the-difference-between-subtyping-and-inheritance-in-oo-programming&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025b, september 26). Fragile base class. Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Fragile_base_class" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Fragile_base_class&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;SunilRai. (2010, 27 mei). What is the fragile base class problem? Stack Overflow. &lt;a href="https://stackoverflow.com/questions/2921397/what-is-the-fragile-base-class-problem" rel="noopener noreferrer"&gt;https://stackoverflow.com/questions/2921397/what-is-the-fragile-base-class-problem&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025f, december 3). Object-oriented programming. Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Object-oriented_programming" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Object-oriented_programming&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Wikipedia contributors. (2025d, november 8). Forwarding (object-oriented programming). Wikipedia. &lt;a href="https://en.wikipedia.org/wiki/Forwarding_(object-oriented_programming)" rel="noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Forwarding_(object-oriented_programming)&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The GO Programming Language specification - The GO Programming language. (z.d.). &lt;a href="https://go.dev/ref/spec" rel="noopener noreferrer"&gt;https://go.dev/ref/spec&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>oop</category>
      <category>go</category>
    </item>
  </channel>
</rss>
