<?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 Senura Diwantha on Medium]]></title>
        <description><![CDATA[Stories by Senura Diwantha on Medium]]></description>
        <link>https://medium.com/@senuradiwantha900?source=rss-9aa01e61a512------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*bK1PwtZmDyfBG9LeOuhgDA.jpeg</url>
            <title>Stories by Senura Diwantha on Medium</title>
            <link>https://medium.com/@senuradiwantha900?source=rss-9aa01e61a512------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:44:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@senuradiwantha900/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[Library or Framework ?]]></title>
            <link>https://medium.com/@senuradiwantha900/library-or-framework-14ec284708e6?source=rss-9aa01e61a512------2</link>
            <guid isPermaLink="false">https://medium.com/p/14ec284708e6</guid>
            <category><![CDATA[inversion-of-control]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[libraries]]></category>
            <dc:creator><![CDATA[Senura Diwantha]]></dc:creator>
            <pubDate>Thu, 20 Feb 2020 16:09:45 GMT</pubDate>
            <atom:updated>2020-02-20T16:09:45.584Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a-LIUSl1oRNMftccSsKCPg.jpeg" /></figure><h3><strong>Library or Framework ?</strong></h3><h4>What is the difference between Library and Framework</h4><p>Why would you prefer framework over the library ? Both frameworks and libraries are reusable codes written by someone else to solve common problem. There isn’t anything magic about libraries and frameworks. Both helps you to solve your problem in easier way. Let me first give you a brief introduction about library and framework.</p><h4><strong>What is Library ?</strong></h4><p>Before the definition part, lets implement some method to “add” two integer values.</p><pre><strong>public</strong> <strong>class</strong> Simple {<br>	<strong>public</strong> <strong>static</strong> <strong>int</strong> add(<strong>int</strong> a, <strong>int</strong> b){<br>		<strong>return</strong> a+b;<br>	}<br>}</pre><p>Yeah !!! You’ve created a simple library.</p><p>Library is a collection of helping methods which you can be used for specific functionality in your code, when you need it. Now you would understand the previous example that we used to add two integers also can be used as a simple library function. In your program there is particular function that will need consistently in your program, you can write common function where you can pass in the necessary parameters to solve your common problem, that also can be a library function. Example of a Library is jQuery.</p><h4><strong>What is Framework ?</strong></h4><p>Framework is collection of inter-related libraries that work together to serve a large purpose. Framework itself an application you can plug your code into it. Example of a Library is Vue.js</p><p>Wikipedia makes it more clear:</p><p><strong>“In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by additional user-written code, thus providing application-specific software”</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ulvGBAxxJ_2NMuMTvHlWHQ.png" /></figure><h4><strong>What is the key difference between library Vs framework ?</strong></h4><p>The key difference of the framework and library lies in a term called <strong>“Inversion of Control”</strong>(IoC)<strong>.</strong></p><p>Imagine the physical library we use our day to day life. Whenever you need a book for your specific work you can borrow it from the book shelves and use it at anytime, which means you are the in charge. Consider about the foundation of a house it like a framework. You build your house on the foundation it gives you the structure when you place your components of the house. That’s the way of framework works. Framework is the in charge.</p><h4><strong>In Technical Terms</strong></h4><p>When<strong> </strong>you call a method from a library you are the in charge because you call it when you need it, so you are in control. When it comes to the framework its the opposite side. In the framework the control is inverted, framework is the in charge of the flow and it provide some space to plug your code and it calls you when plugged in as needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*TebuxQSmXZeyi6NF_5YXRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AGvRkOmQT6aAKevpMAIb3g.png" /></figure><h4><strong>Their Relationship</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y71IGVBNjhrE8vpphorWbA.jpeg" /></figure><p>To work these framework and libraries together it use an API. Think a library as a function of a application, framework as the skeleton of the application, and API as the connector to put those things together. In generally way framework calls the functions implemented in library through the API.</p><h4><strong>“Opinionated” or “Un-opinionated.”</strong></h4><p>Finally, On the idea of being opinionated, Frameworks are more opinionated it order you to put specific files in specific places in project. And framework can initialize itself. On the other hand libraries are rarely opinionated, it rarely give the instructions to where to put your files or not. You have to manually initialize your application because library cannot initialize itself. The different frameworks are opinionated at different degrees. These terms are subjective.When I personally would consider AngularJS a highly opinionated framework, and VueJS a less-opinionated framework.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14ec284708e6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>