<?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 Supun Dileepa on Medium]]></title>
        <description><![CDATA[Stories by Supun Dileepa on Medium]]></description>
        <link>https://medium.com/@paranagamasupun?source=rss-6ee9971cbd53------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*LVZ98CXuA96eg4fa</url>
            <title>Stories by Supun Dileepa on Medium</title>
            <link>https://medium.com/@paranagamasupun?source=rss-6ee9971cbd53------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 16:04:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@paranagamasupun/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[Introduction to Spring Boot]]></title>
            <link>https://medium.com/@paranagamasupun/introduction-to-spring-boot-9b22f97807fc?source=rss-6ee9971cbd53------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b22f97807fc</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Supun Dileepa]]></dc:creator>
            <pubDate>Wed, 11 May 2022 18:17:15 GMT</pubDate>
            <atom:updated>2022-05-11T18:17:15.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*rDDUaNlx2uJT_DWCSa_o1Q.png" /></figure><p>Java <strong>Spring Boot</strong> is extremely popular framework that can be used to create micro services. Spring Boot is very popular because of its rapid application development. Spring Boot is developed on the top of spring framework. In spring framework there was many configurations that need to be done in order to develop an application. But spring boot eliminates those configurations and make easy to start and developing the application. This makes spring boot easy development, simple scalability and minimal configuration. Java Beans, XML settings, and Database Transactions can all be configured in a flexible way in spring boot application.</p><h4>Starting simple spring boot application</h4><p>To start a spring boot project first you need to have java installed on your computer. Pre initialized spring boot application can be generated with <a href="https://start.spring.io/">spring initializr.</a> By this web site you can generate and download a spring boot project as zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*igjvZddZqeuNAKkJ-oiaBA.png" /><figcaption>Spring Initializr Menu</figcaption></figure><p>First you need to select the build tool that need for your spring boot project. This can be <strong>Maven </strong>or <strong>Gradle.</strong> These build tools are programs that let you create executable applications from source code. This compiles the application source code. Maven is the build tool primarily used for java projects. Also maven can be used to manage projects written in different languages such as c#. <strong>Gradle </strong>is also multi-language build automation tool. Then you need to select the spring boot version and the packaging type and java version that the spring boot application is running. In the other side, there is a part to add dependencies to application. This is the most important part in generating the application. In this section, dependencies that used in particular spring boot project is added. In the above example <strong>spring web, spring data JPA </strong>and <strong>PostgresSQL Driver is added.</strong> These dependencies will be necessary things that need to be there to run the application.</p><p><em>Ex:- This spring web dependency has common web specific utilities need for web development and it supports MVC architecture.</em></p><p>There are hundreds of dependencies available and user can select the required dependencies needed for their project. After generating the project these dependencies will be added pom.xml file. Following is a example for spring boot project with maven.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*7cAoTTDyUDIO3oukt2l_zA.png" /><figcaption>Example for dependencies in pom.xml file</figcaption></figure><p>These dependencies will be automatically downloaded to your project when the pom.xml file is synced with maven.</p><h4>Project Structure in Spring Boot</h4><p>As a good coding practice, project can be structured into different packages according to different layers available in n-tier architecture when developing REST service using spring boot. In n-tier architecture there are 3 different layers.</p><ol><li>Control Layer — (Handle HTTP requests)</li><li>Service Layer — (Handle business logic)</li><li>Data Access Layer — (Perform CRUD operations with database)</li></ol><p>You can organize the code into packages based on these layers. Further more can be divided according to the requirement.</p><p><em>Example package structure for REST application using spring boot is given below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*YNAfGK8ZVTV3_cl-YUlm8Q.png" /><figcaption>sample package structure</figcaption></figure><p>In resources, <strong>application.properties </strong>file is very important file. This file stores the application related properties. That means this file contains different configurations that needed to run the application in different environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*pdX4wr6g-WEKpM9AX1KRqA.png" /></figure><p>This is an example for application.properties file with configurations. All the details that needed to connect to database is stored in this file. The database url, database user and passwords are stored in this file. This details are used to run the application and connect application to the database.</p><p>If a application using multiple databases, that details also can give to this folder. Therefor all the configuration details will be stored in one file.</p><h4>Build an executable JAR</h4><p>The developed spring boot application can be run using Maven or Gradle. Also, a single executable JAR file with all the resources can be build. That JAR file also contains the necessary dependencies This JAR file is used when deploying the backend service.</p><ul><li>Run Application</li></ul><p><strong>Maven —</strong>./mvnw spring-boot:run</p><p><strong>Gradle —</strong> ./gradlew bootRun</p><ul><li>Build JAR File</li></ul><p><strong>Maven — </strong>./mvnw clean package</p><p><strong>Gradle — </strong>./gradlew build</p><p>Run Jar File</p><pre>java -jar &lt;file_name&gt;.jar</pre><p><strong>References</strong></p><p><a href="https://start.spring.io/">Spring Initializr</a></p><p><a href="https://spring.io/guides#getting-started-guides">https://spring.io/guides#getting-started-guides</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b22f97807fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Frontend Development with ReactJS and MUI]]></title>
            <link>https://medium.com/@paranagamasupun/frontend-development-with-reactjs-and-mui-364aec5b0a2c?source=rss-6ee9971cbd53------2</link>
            <guid isPermaLink="false">https://medium.com/p/364aec5b0a2c</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[material-ui]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Supun Dileepa]]></dc:creator>
            <pubDate>Sun, 08 May 2022 07:05:22 GMT</pubDate>
            <atom:updated>2022-05-14T12:53:27.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>ReactJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y6C4nSvy2Woe0m7bWEn4BA.png" /></figure><p>ReactJS is fast, efficient and flexible JavaScript library that can be used to develop reusable UI components. ReactJS is placed in the View layer of the MVC architecture. ReactJS is developed by Jordan Walke who worked as a software engineer at Facebook. Today, ReactJS is used to develop small to large scale web applications.</p><p>Also, React has react-native which can be used to develop mobile applications along with native platform capabilities. ReactJS is mostly popular among many developers because of its potential to reuse the components and speed of execution of the application. ReactJS is fast because of its usage of Virtual DOM (Document Object Model). DOM is a tree data structure that hold the data representation of content and structure of a document on the web page. The DOM used in react (Virtual DOM) performs better than the real DOM. When a change is happen to the UI a virtual DOM is created. The react uses reconciliation algorithm (the Diffing algorithm) to compare the old DOM with the new one and identify the areas where the changes are affected. Then react will only render the parts with the changes. So, this process makes the react very fast.</p><p><strong>JSX </strong>is the language that used in react for defining user interfaces. JSX is also like to HTML syntax. But there are small changes.</p><p>Ex:- Instead of using class in html tag, className keyword is used in jsx. &lt;div className=” ”&gt;</p><h4>Thinking in React</h4><p>In react all the content in the web page is considered as components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*7Hu8tAkQxycCLGLugjXc9Q.png" /><figcaption>Example for web page with different components</figcaption></figure><p>The above image shows the web page with different components. According to this web page the whole web page can be considered as a one component. And there is a form to add a new toy. That part is also can be considered as a separate component. Also there is a Container with different toys. That is also a separate component. One toy item is also considered as a separate component. There is no one standard way to divide web page into different components. So, the developer can develop these components separately and assemble all of these components at one place. This is the flexibility that react gives when developing UI’s.</p><h4>Component</h4><p>There are two methods of implmenting component in react.</p><ol><li><strong>Class Based Component</strong></li></ol><p>Example for class based component</p><pre>import React from &quot;react&quot;;</pre><pre>class App extends React.Component {</pre><pre>render() {<br>return &lt;h1&gt;Sample Component&lt;/h1&gt;;<br>    }<br>}</pre><pre>export default App;</pre><p><strong>2. Functional Component</strong></p><p>Example for functional component</p><pre>import React from &quot;react&quot;;</pre><pre>function App(){</pre><pre><strong>return (</strong></pre><pre>     &lt; h1&gt;Sample Component&lt;/h1&gt;</pre><pre>    );</pre><pre>}</pre><pre>export <strong>default</strong> App;</pre><h4>Lifecyle methods in react</h4><p>Reacts class components use lifecycle methods to perform different operations in different states in react app.</p><ul><li><strong>componentDidMount() — </strong>Called as soon as the component is mounted.</li><li><strong>componentDidUpdate() — </strong>Called when a particular item in a component is updated.</li><li><strong>componentWillUnmount() — </strong>Called before the component is unmounted.</li><li><strong>shouldComponentUpdate() — </strong>Called when the component re-renders by default.</li></ul><p>These are the most used component life cycle methods that used in react. This methods can only used in class based components.</p><p>React Hooks can be used to handle lifecycles in functional components.</p><h3>Using Material UI with React</h3><p>Material UI open source project that have customizable, simple and accessible library of react components that implements Google’s material design. The MUI provides high quality Ui components that can be used to develop web application more easily.</p><p>Material UI can be easily added to your project using this command.</p><pre>//material ui with styled components</pre><pre>npm install @mui/material @emotion/react @emotion/styled</pre><p>In material UI all the Ui elements are developed as react components. When you need to add some UI element to your design, you can import that component from MUI and add inside your component.</p><p>Following example shows usage of simple materal ui component inside react component.</p><pre>import * as React from &#39;react&#39;;<br>import Button from &#39;@mui/material/Button&#39;;<br><br>export default function TestComponent() {<br>  return (<br>       &lt;h1&gt;Material Ui Test&lt;/h1&gt;</pre><pre>      &lt;Button variant=&quot;outlined&quot;&gt;Outlined&lt;/Button&gt;<br>     <br>  );<br>}</pre><p>In the above example material UI Button component is used. This will render an styled button as below. You can pass different props in order to change the behavior of the component. In this example the <strong>variant</strong> prop is passed to react component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*h72OzsSfvdhWKAd3CXGGJw.png" /><figcaption>Material UI Button</figcaption></figure><p>Visit Official Material UI API Documentation to discover different Ui Component — <a href="https://mui.com/material-ui/"><strong>https://mui.com/material-ui/</strong></a></p><p>Using MUI in your project or application will make your frontend development process more easier. You don’t need to style or develop UI elements from scratch and you will not need to use CSS at all. Using MUI will make your application according to one theme. Also use MUI <strong>Grid </strong>when implementing complex UI’s. This will help to make your application responsive.</p><p><strong>References</strong></p><ul><li><a href="https://reactjs.org/">React</a></li><li><a href="https://www.geeksforgeeks.org/reactjs-tutorials/">ReactJS Tutorials - GeeksforGeeks</a></li><li><a href="https://mui.com/">MUI: The React component library you always wanted</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=364aec5b0a2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Rest Services and Koa JS]]></title>
            <link>https://medium.com/@paranagamasupun/introduction-to-rest-services-and-koa-js-7924d71e60e5?source=rss-6ee9971cbd53------2</link>
            <guid isPermaLink="false">https://medium.com/p/7924d71e60e5</guid>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[koajs]]></category>
            <dc:creator><![CDATA[Supun Dileepa]]></dc:creator>
            <pubDate>Thu, 05 May 2022 16:56:58 GMT</pubDate>
            <atom:updated>2022-05-05T16:56:58.109Z</atom:updated>
            <content:encoded><![CDATA[<h3>REST</h3><p>The word REST stands for REpresentational State Transfer which is web based standard architecture and that uses HTTP protocol. The REST architecture was introduces by Roy Fielding in 2000. Simply REST services provides access to server resources and have functionality to modify the resources by client.</p><p>In REST architecture each resource is identified by URI. And REST used XML nd JSON( JavaScript Object Notation). JSON is the most famous one used by most of developers. Basically in a Restful system there is a client who request some resources and a server which consist of resources. REST services are heavily used because of its flexibility, scalability and maintainability.</p><p>REST services use basic http methods to perform various operations with te server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6cjGAevnut9YuDmprV1Qmw.png" /><figcaption><a href="https://phpenthusiast.com/blog/what-is-rest-api">https://phpenthusiast.com/blog/what-is-rest-api</a></figcaption></figure><h4><strong>HTTP Methods</strong></h4><ul><li>GET — Retrieve data</li><li>POST — Create a new resource</li><li>PUT — Update resource(Update the entire resource)</li><li>PATCH — Update resource(Update the partial information in resource)</li><li>DELETE — Delete Resource</li></ul><p>In order to be a RESTful service, it has to confirm these criteria.</p><p>There should be a <strong>Client Server architecture </strong>with clients, servers and resources and requests and responses are managed through HTTP.</p><p>The communication should be <strong>Stateless. </strong>That means client state will not be stored in the server and requests are separated from each other.</p><p>Resources returned from the server should be <strong>Cacheable.</strong></p><p>There should be a <strong>uniform interface</strong> between components so that data and information is transferred in standard form.</p><p><strong>Layered System </strong>that hides the complexity of the underlying service.</p><p>There is also a optional one called <strong>Code-on-demand.</strong> That means the ability to send executable code from the server when client requested.</p><h4>Creating RESTFul Services</h4><ol><li>GET — /library/books (show list of books)</li><li>POST — /library/books/addBook (Add Book. details will be passed through request body)</li><li>GET — /library/books/id (Get details of one book)</li><li>DELETE — /library/books/id (Delete one book)</li></ol><p>This is the structure used when creating RESTFul web services</p><h3>KoaJS</h3><p>KoaJS is a and open source NodeJS framework for building web applications and APIs. KoaJs is also developed by the team who developed express. KoaJs is used by developers because of its minimal, flexibility and robust nature. KoaJs also has better error handling and KoaJS use context to encapsulate the request and response into a single object. KoaJs is also popular because of the readability of the code. The main disadvantage of KoaJs is the relatively small open source community in it.</p><p>Creating a KoaJS app is extreamly simple. The following example show displaying Hello message in browser using KoaJs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*QsjFLp1rWptpa17XsSJ3ew.png" /><figcaption>Creating a simple App</figcaption></figure><p>This application will run on port 3000 on localhost. You can simple check by typing http://localhost:3000 searching on browser search bar. Then the about html file will be displayed.</p><p>This simple KoaJs app can be improved as a REST application.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7924d71e60e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic concepts of JavaScript, GIT and MongoDB]]></title>
            <link>https://medium.com/@paranagamasupun/basic-concepts-of-javascript-git-and-mongodb-eb9a1d5ee2a0?source=rss-6ee9971cbd53------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb9a1d5ee2a0</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nosql]]></category>
            <dc:creator><![CDATA[Supun Dileepa]]></dc:creator>
            <pubDate>Mon, 14 Mar 2022 16:17:00 GMT</pubDate>
            <atom:updated>2022-03-14T16:17:00.440Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*HST2qS8x2uvYCo25qntRNA.jpeg" /></figure><h3>JavaScript</h3><p>JavaScript is a cross platform, object oriented scripting language which can be used to make more interactive webpages. JavaScript contains standard library of objects, such as Arrays, Math, Date and a core language elements such as operators, control structures and statements. JavaScript is also a dynamically types language. So, JavaScript itself determines the variables and values stored in it. Earlier JavaScript is only used to make webpages more dynamic. Today, there are more advanced server side versions of JavaScript such as Node.js. Also, there are many JavaScript frameworks and libraries which can be used by developers.</p><p>In order to get familiar with new JavaScript tools and technologies, there should be a basic understanding about concepts in JavaScript.</p><blockquote><strong>Callbacks &amp; Promises</strong></blockquote><ul><li>In JavaScript callback is the method of passing function as a parameter of another function. In this type of scenario the passed function will be executed inside the function it was passed to. So, in JavaScript this strategy can be used to achieve the synchronous operation of the code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*RZzgp-v7AxEeGUcXMzuKPw.png" /><figcaption>Example for callback</figcaption></figure><p><strong>CallBack Hell</strong></p><p>Callback hell is the issues occurred due to complex nested callbacks in the code. Here, every callback will take an argument which is result of the previous callback. Because of this readability of the code will be reduced. So, promise object is introduces as a solution to this problem.</p><ul><li>A promise is a JavaScript object that perform some operations based on the its success or failure. The promise object links the both producing and consuming code. <strong>Producing code </strong>is the code that may take some time to execute. <strong>Consumer code </strong>is the code that need to be waited for the result from that code. So, promise have properties to dealt with asynchronous operations synchronously.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*y0-6OYKwBDZhVz8YeKOM5Q.png" /></figure><blockquote>Async/await</blockquote><p>Async await is a special syntax of working with promises in a more readable and easier way. Adding the ‘<strong>async</strong>’ keyword before the function means that the function will always return a promise. The ‘<strong>await</strong>’ keyword will wait for the asynchronous operation/promise to resolve before executing further.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*5HkFDMZpqhwQvkXjMkYvGQ.png" /></figure><p>These concepts will be essential when working with JavaScript. Above we discussed about callbacks, promises and how to work with these basic concepts.</p><h4>Version Control</h4><p>“Version control is the process of tracking and managing changes to Software Code.” Version control will be essential when working multiple developers on a same project. This will help developer team to efficiently track the changes have been applied to the source code and find more information about each all the changes. Version controlling is heavily used in open source development as well.</p><blockquote>What is Repository?</blockquote><p>Repository is the place where all the files, data stored in a version control system. There can be remote repository and local repository. Remote repository is the place where files are hosted on the internet. In the other hand local repository is stored in the current pc.</p><p><strong>Terminology</strong></p><p>Stage — Tracking the changes that have been done to the files in the repository.</p><p>Commit — Sends latest changes to the repository make a snapshot of it.</p><p>Branch — Copy of the master branch is stored in each branch. Users will be able to add changes to a particular branch without affecting master branch.</p><p>Merge — Combining changes in one branch to other.</p><h3>GIT</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*pXqaqyxKfeO__szKOIbsjQ.png" /></figure><p>GIT is one of the most popular open source version control system used by many users and organization.</p><p><strong>Basic GIT Commands</strong></p><ul><li>git clone — Make a copy of remote repository in local.</li><li>git init — Initialize local git repository.</li><li>git log — List all the commits that made in the repository history.</li><li>git add — Adds new or updated files to the Git staging area from your working directory.</li><li>git commit —Commit the changes to the repository.</li><li>git push — Push the changes to the remote repository.</li><li>git branch [BRANCH_NAME] — create branch.</li><li>git checkout [BRANCH_NAME] — Checkout to existing branch.</li><li>These two steps can be done in one line <strong>git checkout -b [BRANCH_NAME]</strong></li></ul><blockquote><strong>NoSQL Databases</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*PWLfJlpM8wVhY7VpWeZqmQ.png" /></figure><p>NoSQL database is a type of database which can be used to store wide variety of data. NoSQL database is not a relational database. Therefore NoSQL databases do not use schemas to store data. Normally NoSQL databases follow ACID principles (Atomicity, Consistency, Isolation. Durability).</p><p>Most of the NoSQL databases do not have transactional support. Also most of the NoSQL databases are open source.</p><p>Mainly there are 4 types of NoSQL databases.</p><ol><li><strong>Document Database</strong> — Data is stored in the database as JSON objects in Maps or collection. Developers will be able to create and update programs without having reference to the master schema.</li><li><strong>Key-value Storage</strong> — This model store the data as a unique key with an value associated with it.</li><li><strong>Column Family</strong> — This is also similar to the relational databases. In here, data is stored in large columns together without storing the data in rows.</li><li><strong>Graph Databases </strong>— In this model data will be organized as nodes. This is used to store large amount of data in a structure like a graph. Commonly social networking websites use graph databases.</li></ol><h3>MongoDB</h3><p>MongoDB is a document type NoSQL database which can be used to store large amount of data. Each database of MongoDB will contain collections and each collection will contain documents. MongoDB uses the SpiderMonkey as the JavaScript engine for the database. MongoDB has high availability because of the replica set.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Dn1d9lNAbDa92UmRfAoNYw.jpeg" /><figcaption>MongoDB Replica Set</figcaption></figure><p>There are three nodes in MongoDB. If one node stops functionality then the other node will handle the tasks of the database. Therefore, there will be no downtime in the database if an error occurred in one node.</p><p>MongoDB official drivers support most of the programming languages such as C, C++, Perl, PHP, Rust, C#, Java, Python, Ruby, Scala, Go, Node.js, and Erlang. Because of the ease of development, scaling, and flexibility in MongoDB is very popular among many users.</p><p><strong>References</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">JavaScript | MDN</a></p><p><a href="https://docs.mongodb.com/">https://docs.mongodb.com/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb9a1d5ee2a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Application Framework — Blog Article 1]]></title>
            <link>https://medium.com/@paranagamasupun/application-framework-blog-article-1-3fdd570131c2?source=rss-6ee9971cbd53------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fdd570131c2</guid>
            <dc:creator><![CDATA[Supun Dileepa]]></dc:creator>
            <pubDate>Wed, 23 Feb 2022 04:49:41 GMT</pubDate>
            <atom:updated>2022-02-23T04:54:06.881Z</atom:updated>
            <content:encoded><![CDATA[<h3>Application Framework — Blog Article 1</h3><h4>SOLID Principles</h4><p>SOLID principles are five object oriented design principles that can used to make more understandable, flexible and more maintainable software. These five principles were first conceptualized by Robert C. Martin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*zeYOSSoAwtb8SAKDs0JodQ.jpeg" /><figcaption><a href="https://www.lexicon.com.au/blog/oot-solid-principles">Five Solid Principles</a></figcaption></figure><h4><strong>Single Responsibility Principle</strong></h4><p>Simply, the single responsibility principle(SRP) means a class should have only a <strong>single responsibility(job)</strong>. In order to achieve single responsibility principle, A computer program’s module, class or function should be responsible for single part of the program’s functionality.</p><h4><strong>Open Close Principle</strong></h4><p>In Open Close Principle(OCP) asoftware module <strong>should be open for extension but it will be closed for modification.</strong> There should be an abstraction between classes. If only these classes will be open for extension. In this principle there will be no change to the existing class structure.</p><p><em>Ex:-</em> <em>If there is a </em><strong><em>AreaCalculator </em></strong><em>class and </em><strong><em>Circle </em></strong><em>class. If we want to calculate area of a </em><strong><em>Rectangle</em></strong><em>, we should not add the implementation to calculate area of Rectangle inside </em><strong><em>AreaCalculator</em></strong><em>. We can introduce new abstract class </em><strong><em>Shape </em></strong><em>and decouple the </em><strong><em>AreaCalculator </em></strong><em>with the </em><strong><em>Circle </em></strong><em>and the </em><strong><em>Rectangle</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*vod9QcrF_xwbozW9XDOCFA.png" /><figcaption>Open Close Principle Example</figcaption></figure><h4>Liskov Substitution Principle</h4><p>LSP means that, <strong>“derived types must be completely substitutable for their base types.”</strong> So, the simple meaning of this is, if one class extending another class, that class should have totally replaceable for the base class. There for the child class should not have any unimplemented methods on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*wzLOGscNs-b49Jhwb33NHQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*TjR-33xERWeTcmNd8K3ygA.png" /></figure><p><em>Example :- There should be no</em><strong><em> fly()</em></strong><em> method on </em><strong><em>Ostrich </em></strong><em>class. It is belong to </em><strong><em>Bird class </em></strong><em>but it can not fly.</em></p><h4>Interface segregation principle</h4><p>Interface segregation principle states that<strong> clients should not be forced to implement methods that it does not use.</strong> The dependency of one class to another should depend on smallest possible interface. Instead of one fat interface there should be many small interfaces preferred based on groups of methods. So, keep interfaces as small as possible.</p><h4>Dependency Inversion Principle</h4><p>The Dependency Inversion Principle (DIP) means that <strong>high level modules should not depend on low level modules, but it should depend on abstraction. </strong>Abstractions should not depend on details. Details should depend upon abstractions.</p><ul><li><strong><em>Higher level modules </em></strong><em>— Contain important policy decisions and business models of an application.</em></li><li><strong><em>Lower level modules</em></strong><em> — Contain detailed implementation that are required to execute the decisions and business policies.</em></li></ul><h3>JavaScript</h3><p>JavaScript is a cross-platform, object oriented scripting language that can be used to make web pages more interactive. JavaScript is an <strong>interpreted </strong>programming language. In contrast, JavaScript do not have a compilation. Instead interpreter in the browser reads the JavaScript code and runs it. JavaScript is also a dynamically types language. So, JavaScript itself determines the variables and values stored in it.</p><p>JavaScript is single threaded language and in the other hand Java can be considered as multi threaded language because of its nature. Because of <strong>non blocking I/O</strong> nature JavaScript is a asynchronous programming language. (NIO — i/o operations will be executed first).</p><p><strong>References</strong></p><p><a href="https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript">MDN Web Docs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fdd570131c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>