<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Elwin on Medium]]></title>
        <description><![CDATA[Stories by Elwin on Medium]]></description>
        <link>https://medium.com/@loveuku04?source=rss-15db4747b156------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aMkgKsUt97_RvOiTSngCYQ.jpeg</url>
            <title>Stories by Elwin on Medium</title>
            <link>https://medium.com/@loveuku04?source=rss-15db4747b156------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:47:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@loveuku04/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why we should use an interface?]]></title>
            <link>https://medium.com/@loveuku04/why-we-should-use-an-interface-cec047cf858e?source=rss-15db4747b156------2</link>
            <guid isPermaLink="false">https://medium.com/p/cec047cf858e</guid>
            <category><![CDATA[interfaces]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[oop-concepts]]></category>
            <dc:creator><![CDATA[Elwin]]></dc:creator>
            <pubDate>Sun, 10 Apr 2022 18:44:53 GMT</pubDate>
            <atom:updated>2022-04-10T18:44:53.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*jPRY9EqjHApjNWT5F8ED7w.jpeg" /><figcaption>Image by Gerd Altmann from Pixabay</figcaption></figure><p>Have you ever heard about <em>Dependency Injection</em> and <em>Inversion of Control</em>?</p><p>They are very important concepts in Object-Oriented Programming.</p><p>I was really curious.</p><p>Because every online course says about <em>Interface, Repository patterns</em>.</p><p>However, it was really hard to find “why”.</p><p>So, I bring some knowledge about why using the interface from a memory point of view.</p><p><strong>Here is the example memory table</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*aU6DkrC6Hl0_YIPKfxtz3Q.png" /></figure><p>Then assign variable A with “Test”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*IjIElhHxHNWmC2muATGwvg.png" /></figure><p>Assign B, C, D now B, C, D has the same address as “7”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*WBDmg95yAyoKqqPqp4hCyw.png" /></figure><p>But what if B changed with another value…</p><p>If there is a “K” for it.</p><p>![memory4](Memory-4.png)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*lT37KDhj5tUFY9ZKdaSdHg.png" /></figure><p>Then C and D will be the same value as “7”</p><p>“B” is already changed but C and D still have the same address number.</p><p>This will cause a big problem.</p><p>When B is changed C and D should change as well, but they still keep the</p><p>address 7.</p><p>If you print out the value of C or D,</p><p>- Your expectation: “Bob”</p><p>- Real result: “Test”</p><p>How to solve this problem?</p><p>Let’s make a new object which has “value” and “v”</p><p>And assign B with the object</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*hvbqzWsY-V07Zh8mEV1c_A.png" /></figure><p>Now, B, C, D has the same address as “16”</p><p>And value is on address number 17,</p><p>v is on address number 18.</p><p>Then what if the value is changed with the “Bob” string.</p><pre>B.value = &amp;K</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*BxdGl2PK5de93JrNAZRYYA.png" /></figure><p>“value” is changed and address 2 is assigned to the value’s memory address.</p><p>Now you can get the right result.</p><p>By using interfaces like this, you avoid the problem of direct references and</p><p>use indirect references, which makes it possible to design your code reliable.</p><p>Please correct me if there are any mistakes</p><p>Thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cec047cf858e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First Post…]]></title>
            <link>https://medium.com/@loveuku04/my-first-post-85d1b2d2bb7e?source=rss-15db4747b156------2</link>
            <guid isPermaLink="false">https://medium.com/p/85d1b2d2bb7e</guid>
            <dc:creator><![CDATA[Elwin]]></dc:creator>
            <pubDate>Wed, 06 Oct 2021 04:12:57 GMT</pubDate>
            <atom:updated>2021-10-06T04:12:57.734Z</atom:updated>
            <content:encoded><![CDATA[<p>My post mostly will be my developing record.</p><p>See you soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85d1b2d2bb7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>