<?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 Niroshan Ratnayake on Medium]]></title>
        <description><![CDATA[Stories by Niroshan Ratnayake on Medium]]></description>
        <link>https://medium.com/@niroshanratnayake?source=rss-29c320bbe975------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*N6IVpDrs7Flg6pKaMuLa_Q.jpeg</url>
            <title>Stories by Niroshan Ratnayake on Medium</title>
            <link>https://medium.com/@niroshanratnayake?source=rss-29c320bbe975------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 17:53:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@niroshanratnayake/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[How Github Copilot effects Developers?]]></title>
            <link>https://niroshanratnayake.medium.com/how-github-copilot-effects-developers-e462d7fd760c?source=rss-29c320bbe975------2</link>
            <guid isPermaLink="false">https://medium.com/p/e462d7fd760c</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Niroshan Ratnayake]]></dc:creator>
            <pubDate>Mon, 05 Jul 2021 19:32:38 GMT</pubDate>
            <atom:updated>2021-07-05T19:32:38.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*mBBJKCHafWwP-a5_b5_4Ng.png" /><figcaption><a href="https://copilot.github.com/">GitHub Copilot</a></figcaption></figure><p>“Github copilot” is a trending topic among developers these days. Are the Software developers at risk? Will this reduces the opportunities for the developers in the industry? What actually the Github copilot is all about? If you are curious to know; this particular article is just for you😉! Sit back relax you developers are not at risk as you think ;) Let&#39;s dig in💨</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXM7eRwQ51QpzRQVZbT1lg.jpeg" /><figcaption><a href="https://www.hull.ac.uk/">Data Sceince &amp; AI</a></figcaption></figure><p>Programming, data science, machine learning, and artificial intelligence (AI) are the terms that people are most likely to make arguments around, and the less they understand these terms, the more they like to make theories around them, and AI is the least understood of these terms, so all the conspiracy theories usually revolve around it. The term AI is an excellent tool for product promotion on which algorithms can be taught to obtain a kind of reasonable outcome. But to be honest as of my knowledge, programmers don’t always get decent results in AI. AI is simply combining a little bit of data with a little bit of mathematics to produce results that can be good, sometimes other way around.</p><p>So, to get to the point, what is GitHub’s co-pilot? In a nutshell, GitHub Copilot can quickly propose individual lines and complete functions based on a programmer’s codes and comments. GitHub has released a preview of a new artificial intelligence (AI) tool that can make suggestions to developers as they’re coding, allowing them to generate better code with less effort. Simply its a code suggesting platform powered with AI with the help of all the code that are on github.Right now the most occuring question, “will this take your oppotunities?”. Come on…. It’s almost as if we’re saying, “The complete code is on Stack Overflow”, we can just copy and paste these codes, why do we need programmers?” If you can do it, you’re welcome to do it, and you’ll soon realize how difficult it is to simply copy and paste code from Stack Overflow. And you may know the circumstances in the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*KVKihEaRNpgrz2KxoL8hwQ.gif" /><figcaption><a href="https://copilot.github.com/">Github Copilot — Code Suggestions</a></figcaption></figure><p>It can take days to actually just nicely fit in that code, which is already freely available on Stack Overflow. Programming is not just about injecting code, it’s about fitting code, solving a problem, and if you’re that concerned about this nice piece of tool coming out, you should be much more concerned about without code stuff or no code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*-zMylZrVA6bJ0ocTMGO1RQ.png" /></figure><p>Okay, so how does GitHub copilot work? There is no access granted as of 06th July 2021. Eventually, it will be rolled out to everyone, but as the website states, it will be given to you as a simple VS code extension, and you will have to write some meaningful comments, after which GitHub copilot will automatically suggest you some methods based on the code it has gotten from your GitHub accounts and the Stack Overflow. So is this 100% accurate Obviously not. That’s why they provide you many suggestions, and once you’ve chosen the one that comes closest to solving your problem, you manipulate it just like you would code from Stack Overflow; it’s now a kind of clipboard provided by the copilot. That is a fantastic approach, in my opinion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*12Xqe9eQ4hLh4TlqhqSQMQ.png" /><figcaption>How Github Copilot works</figcaption></figure><p>Copilot was the first to come up with this idea and carry it out? No its a big no.There are existing companies with the exact same concept that are somewhat more popular or less popular. Kadota and kite are some AI Powered similar examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L6X8jQ--PV1wyeI6VRRsmg.png" /></figure><p>So, rather than claiming that AI will take over the oppotunities , a better issue could be whether or not to use this product. As per my knowledge and as the personal view we should use this product because it’s almost like a walkthrough. There was a time when people said that you shouldn’t use Sublime Text or IntelliSense and that you should write all your code in the text pad because the text pad gives you more clarity and knowledge about the syntax. Yes there is a true behind that for the developers who are getting in. Having said that the industry is moving fast and the faster you produce the products more the attractive ness comes in; obviously the quality matters.</p><p>Github copilot will assist programmers in writing code more quickly, but these suggestions will sometimes never be useful, and they may even cause more confusion in your code. So you’ll need a little more intellect and programming knowledge to make sure that you’re cleaning up all the messes that these AI are making. Naturally, others would argue that Microsoft could not have done this because they used all of our open source code and trained their model on it. Surely, they have trained their models with the open sorce code that are available, and according to me it should be taken as a positive factor going ahead with the technology rather than making argivements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*gfjFoncIHSZq37YzuHfNtg.jpeg" /></figure><p>Have you heard of Hasura, a comparable technology that allows you to build a database’s model and it provides all of the basic functions as well as a little extra via GraphQL? They could have gotten a lot more attention if they had used the same word AI that we are using to generate all these, but they didn’t. <em>So accept the idea that programming will continue to evolve in order to provide you with new tools to help you create even more fantastic products.</em></p><p><strong><em>So, rather than going into full conspiracy mode, consider it as a useful tool that will assist us in the future.</em></strong></p><p><strong>Conclusion</strong></p><p>You shouldn’t be concerned about losing your oppotunities in the industry because of no code, AI, copilot, or any; they are simply tools to assist you in doing your regular work; you shouldn’t go into conspiracy mode; and as of my view giving all of these tools a try and seeing how well or poorly they perform is of course the better way.</p><p><em>Motivation </em>: Go ahead and push more code to GitHub, so that Microsoft can get more data to train their model thus, we could get good suggestions from the appliacation and code as quickly as possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e462d7fd760c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CI/CD Simply Explained!]]></title>
            <link>https://niroshanratnayake.medium.com/ci-cd-simply-explained-9beeddbfe6de?source=rss-29c320bbe975------2</link>
            <guid isPermaLink="false">https://medium.com/p/9beeddbfe6de</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[test-automation]]></category>
            <dc:creator><![CDATA[Niroshan Ratnayake]]></dc:creator>
            <pubDate>Mon, 07 Jun 2021 18:05:18 GMT</pubDate>
            <atom:updated>2021-06-07T18:05:18.626Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*SXB43P5hp-oKoi1CchdQHQ.png" /></figure><p>The concept of CI/CD is very hot in the industry everyone’s talking about this concept, especially if you’re working on the dev-ops, it’s amazing. Every developer should keep an understanding of this interesting concept. If you are interested, this article will help you to have a basic understanding of CI/CD.</p><h4>Background For CI/CD</h4><p>What is this so-called CI/CD actually mean? What makes it so interesting? Before understanding this concept, let’s understand why it came. So let’s go back a few years, and let’s talk about the waterfall model. Simply in the waterfall model, a client comes and gives his requirements and ask us to build his project right? And developers keep on building day in day out. Now, in this case, it will take some time for you to make a working project. It may be six months or one year maybe 2 to 3 years. Now, in this case, many issues came across in the development process. Many of them are due to miscommunication. That is something we all know about the waterfall model which is already outdated due to many reasons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*HVlovyhZFcnU84sugd4u-g.png" /><figcaption>agile development process</figcaption></figure><p>In order to have a smooth flow, you need that continuous feedback that was lacking in the waterfall model. And that’s why we are using a different approach nowadays, which is Agile. With the use of Agile, you give your client a working product every two to three weeks. It&#39;s not the entire product but parts of it, most importantly it&#39;s a working product. So let’s say if you have 20 features in the full product and you can give one feature in two weeks or three weeks and adding features continuously which is really amazing for both the developers and clients because both the parties will get continuous feedback. This is the first thing you have to understand <em>adding features continuously</em>. And now let’s say, you are working on a project, and in that project, you have certain modules, and you have multiple developers to work on it. And let&#39;s say each and every developer assigned to one particular module. And for background purpose, let&#39;s say Java is used to develop this particular software and you will write a Java code and you are also responsible for testing. And for testing, you will be using the JUnit(boring stuff are over 🤪). Right now, when you test your class, it is perfectly working so your unit testing is working perfectly. Are we done with it? no right. We have missed another testing called integration testing. When many developers are working in a team the integration of each module should happen and needed to be tested whether they all are working fine as a whole.</p><p>Then comes the involvement of the operational teams and QA team. Now your operation teams are responsible to take the project and deploy it on the server. But what about the Integration testing? So for that, we have this automation test thing. Let’s say every Friday the team will deploy by integrating the project, and then there will be an automation test. What if something goes wrong in the automation test. The bug fixing will have to be done at the weekend which doesn&#39;t look good at times. So it&#39;s a huge problem in the industry where you find bugs when trying to integrate and wait another week or so to deploy after the bug fixes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Nqxa5E46dEyS243gXVyQA.png" /></figure><h4>Continuous Integration</h4><p>But it&#39;s no more a problem with the concept of CI. So CI stands for Continuous Integration. Imagine that you, integrate your modules very often, let’s say in a day, you will be doing maybe five to six commits which leads to major changes in the output. Every time you think it’s working for you, then you need to test and commit to the shared repository. The advantage would be if you have five developers, all these people will be committed to the repository, and every time you commit, there will be an automation test happening. That means, you write the code, then commit and testing happens behind the scene. So, at the end, or after every commit we’ll be having a production-ready project, which is tested and the team have the confidence of having a working product. So that’s the beauty of CI. In the process of CI, it is not about committing your work at the end of the day or after a week but it&#39;s about committing once it&#39;s working for you and when the unit tests are working properly, your code is ready to be shared with the repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*B8ejTPSTIdoKjteno71Viw.png" /></figure><h4>Continuous Delivery</h4><p>We also have a concept of continuous delivery which comes after CI. Now, In CD we have two parts of CDs, Continuous Delivery and Continuous Deployment. People often mix those two terms which are two different terms. It’s important to understand the difference between delivery and deployment. When you are in the process of continuous integration, you have a perfectly working project which is ready for deployment. If your client says that he wants to see the progress, you can simply show them the working model may be on a demo server. So it will give you confidence and it will also make your client happy which is the most important thing. In addition to that, you can also check the performance of the system. So when you shift your project to your demo environment, it can be called delivery. So of course you will not be deploying it on the production server, but you are keeping it ready for deployment. So at any point, you can think of deploying it. Up to now, we talked about integration in which you’re pushing the code to the shared repository regularly and the rest is handled automatically and delivery is making it available for deployment.</p><h4>Continuous Deployment</h4><p>What is continuous deployment then? First thing is to be note is that continuous deployment is a bit scary, because when the moment you commit your code and after the automation test your code will be directly deployed on the production server. If there’s something wrong, you’re gone😶. But it doesn’t happen very often. So you have the code, you’re committed, and first you unit tested it, then there’s automation test, and then it goes to the production server that is continuous deployment. Not every company stick to this process because every company have different requirements, strategies and approaches. Some companies only go for CI, they don’t go even for CD. Some companies go for continuous delivery and some companies go for continuous deployment depending on the requirements and needs. Teams who are working with microservices, believe in continuous deployment, and there are some big companies like Facebook, they adhering to this approach where the code, commit and will be deployed on the server.</p><p>So CI/CD is that easy to implement? The answer is no because initially you have to make your team ready for this and secondly you have to get a pipeline so that, everything will happen in a sequence. You will be committing, testing it, and then you’ll be going for deployment which is a huge process that needed to happen in a sequence. So that’s a code pipeline that you have to build. There are a lot of different tools are available for this, we can use Jenkins, which is one of the best tool available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*461qdel2ir7KUZ3DLoRMVQ.png" /><figcaption>Tools available for Continuous Integration</figcaption></figure><h4>The Take-Away</h4><p>A CI/CD pipeline is a sequence of actions that must be done in order to release a new version of the software. Continuous integration/continuous delivery (CI/CD) pipelines are a practice focused on optimizing software delivery using either a DevOps or site reliability engineering (SRE) approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9beeddbfe6de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Do Cookies Actually Mean?]]></title>
            <link>https://medium.com/linkit-intecs/what-do-cookies-actually-mean-19511f2584d2?source=rss-29c320bbe975------2</link>
            <guid isPermaLink="false">https://medium.com/p/19511f2584d2</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[https]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Niroshan Ratnayake]]></dc:creator>
            <pubDate>Wed, 02 Jun 2021 07:49:52 GMT</pubDate>
            <atom:updated>2022-01-21T20:32:59.037Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*ez3TFgnoLes2A1MMGNlUtA.jpeg" /><figcaption><a href="https://www.plat4om.com/what-are-http-cookies-tiny-files-that-save-data-about-your-online-presence/">Image Source</a></figcaption></figure><p>If you are browsing the internet, definitely you should have seen a notification pop up similar to what you see in the below picture telling you that this website uses cookies. Most of the time you just slap on Agree button at a glance to get your work done ;).So HTTP Cookie is something that is a very familiar term among us. But the meaning and its behaviour are unknown to many. You’re likely here because you want to know what exactly are cookies, and how do they actually work. We are not talking about that tasty and sweet cookie thing, rather we’re talking about website cookies, which are more formally called HTTP cookies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*3FHFWhOuhaJ1E4wWefJS5A.png" /><figcaption>Screenshot by Author — Notification Popup of Cookie We Usually See</figcaption></figure><p>Right then, will jump straight away to the concept. So a cookie is a small piece of data from a specific website that is stored on a user’s computer while you’re browsing the web, and these cookies can have many functions, such as keeping track of a user’s browsing activity, in order to serve up targeted information, such as advertisements for goods or services. To simplify let&#39;s say that you are browsing eBay for a Perfume and later that day when you scroll Facebook you might see ads for more perfume on Facebook. You may be wondering how that happened. But that was you who slapped on accept all cookies button right? Furthermore, cookies can also have simple functions like remembering your login details for a specific website such as Facebook, so that you can close out of it, and then reopen it again later, without having to log back in again which makes our life easier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J77jRM-lIvrXIe1AExbCUA.jpeg" /><figcaption><a href="https://nordvpn.com/blog/third-party-cookies/">Image Source</a></figcaption></figure><p>Since a Cookie has its own unique ID, website owners can keep track of exactly how many visitors getting to their website. If the user visits the same website two three or more times in a day, a cookie can allow us to count this as one unique viewer. So website owners can collect more accurate data about their website traffic.</p><h3><strong>Bit of History</strong></h3><p>Let&#39;s have a bit of History to this so-called cookie. So from where did, the cookie comes from and how did it get its name. The first cookie was invented in 1994 by a 24-year-old programmer, named <a href="https://www.historyofinformation.com/detail.php?id=2102#:~:text=1%20of%2017%20pages.,Corporation%20invented%20the%20HTTP%20cookie."><em>Louis J. “Lou” Montulli</em></a>, he was creating an online store for a company whose servers were getting too full from storing each individual user’s shopping cart data while they were browsing the store each time. So<em> Lou</em> was asked to figure out a way to store each user’s shopping cart data on their own computer, which would then save server space for the company, and save a huge amount of money and space. So he thought back to an old computing token called the magic cookie, which was used to identify when somebody would log into a system by passing a tiny bit of information between the server and their computer, Lou then recreated this concept for web browsing, and thus, the modern-day cookie was born cookies today are still used to identify your computer, but now they have the added function of also tracking your activity, which can be very helpful, or a breach in privacy depending on how the website decides to use this information, which is why you get that little notification whenever you visit a website that uses cookies because they’re legally obligated to inform you in their cookie policy of what they use these cookies for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V87tv53HNWe_e0V1fF8G0A.png" /><figcaption><a href="https://www.bounteous.com/insights/2020/04/09/google-chrome-third-party-cookies/">Image Source</a></figcaption></figure><h3><strong>How do cookies work?</strong></h3><p>Best for last! how does a cookie work? Let&#39;s get this done with an example of you browsing an online store for the first time. The website puts a cookie on your hard drive that has its own unique ID code. The site then uses this ID to keep track of your overall session from start to end. The reason for doing this is to keep track of things like which items you put in your shopping cart, Or, which items you looked at so it can suggest similar items, or even save coupon codes for you, that can be used later even if you close out of the website and come back to it, and they have many more functions than this but this is just some of the most common ways.</p><h3><strong>Third-Party Cookie</strong></h3><p>You may question a cookie is only specific to a particular website, meaning that they can’t track you on a totally different website? If no how eBay suggestions appear on Facebook? Well, there’s another type of cookie called a third-party cookie for these kinds of interrelationships among the sites. Let&#39;s try to clarify this with an example. A user might go to the website ebay.com. First-party cookies are those set by ebay.com on this domain. A third-party cookie is one that is set by another website, such as advertising or a social media site for example Facebook. which means that Facebook can now send their own cookies, through this website in order to track your activity, and then most likely serve up some targeted advertisements for you on your Facebook newsfeed later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YNQidqablPEs4QvP-Q93dA.png" /><figcaption>How First-Party Cookies Work With Third-Party Cookies (<em>From </em><a href="https://searchengineland.com/the-state-of-tracking-and-data-privacy-in-2020-329259"><em>The State of Tracking and Data Privacy in 2020</em></a><em> by Andrew Garberson)</em></figcaption></figure><h3><strong>The Take-Away</strong></h3><p>Cookies have been passed and allowed to use by GDPR, which is the general data protection regulation, allowing users to opt-out of the use of cookies if they choose so. But not all cookies are privacy breaching parasites and they will generally help you have a much more enjoyable user experience on the web and save you lots of time and headache.</p><p>Everything has two sides so some can be privacy breaching too. So keep mindful of that as well…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19511f2584d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/linkit-intecs/what-do-cookies-actually-mean-19511f2584d2">What Do Cookies Actually Mean?</a> was originally published in <a href="https://medium.com/linkit-intecs">LinkIT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MVC Architecture, Simply Explained!]]></title>
            <link>https://niroshanratnayake.medium.com/mvc-architecture-simply-explained-124729732c67?source=rss-29c320bbe975------2</link>
            <guid isPermaLink="false">https://medium.com/p/124729732c67</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[software-design-patterns]]></category>
            <category><![CDATA[mvc]]></category>
            <dc:creator><![CDATA[Niroshan Ratnayake]]></dc:creator>
            <pubDate>Mon, 19 Apr 2021 09:05:07 GMT</pubDate>
            <atom:updated>2021-04-19T09:09:31.110Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WrAnI28NgQYOgHqZXenj1w.jpeg" /></figure><p><strong>Introduction to MVC architecture</strong></p><p>In the early days, there was no specific structure to create applications. Since the complexity of applications started increasing daily, people used to find new ways of creating applications that can help to create applications fast and easy. One such architectural paradigm for programming is MVC, which was designed in 1979.</p><p>MVC stands for Model-View-Controller. It is a software design pattern with an architecture that helps to create huge applications easy. But it doesn’t belong to a specific programming language or framework. It’s just an architecture that can be used to create any kind of application in many languages and frameworks. To use frameworks efficiently and easily, understanding MVC is really helpful. Rails, CakePHP, Django, Laravel, AngularJS are some of the frameworks that use MVC architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*W1hpV6-ubOoO9n82KgjeWw.png" /><figcaption>some of the frameworks that use MVC architecture</figcaption></figure><p><strong>Design Diagram</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bD89l7bn8F2Asnchbmbzsg.png" /><figcaption>High-level architecture of MVC</figcaption></figure><p>Model, View and Controller are three different parts of MVC architecture. Each part plays an important role in application development.</p><p><strong>Why and where architecture is used?</strong></p><p>In an application, software components are to be done one thing. If the components start doing more than one thing, things will become more complicated and the code readability will decrease. Basically, the Models contain the business logic where it represents the things in your application. The view presents the data to the user. The controller decides what to do with the various user actions. When you stick to that, the code is easy to read because things are as simple as possible. The idea behind MVC will be more helpful when the project gets much more complex. For a simple application like to-do, it may not be that much helpful. But for huge projects and Enterprise applications, MVC architecture gives more and more value. Simply put MVC architecture is a way of thinking or way of structuring web applications in such a way that you never repeat yourself which result in a very well organised, structured and clean codebase.</p><p><strong>The Model — (Interacting with database)</strong></p><p>This is more into Adding and retrieving items from the DB, Processing data from or to the DB. Most of the time the model speaks only with the controller.</p><p><strong>The View — (Displaying to the User)</strong></p><p>This is the only thing the user ever sees. Most of the time speaks only with the controller. (view usually doesn’t interact with the model, but for some situation, it can be done). This can bethink as a webpage in a browser and that&#39;s all you see. No logic or database you will see. The view is there for the user to interact and the rest are done by The Controller and The Model</p><p><strong>The Controller — (Interacting with the user actions and responses from the model)</strong></p><p>Processes GET/POST/PUT/DELETE request. Act as a middle man to take information/data from the user, process information/data and talk to the DB if needed, Receive information from DB. Speaks to the view in order to explain the presentation to the viewer. And controller indirectly connects with the user because what the user wants to do is obviously the controls in the controller.</p><p><strong>Advantages and Disadvantages</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lpbn3Bccbpy6WR8Rv5suuA.png" /><figcaption>pros and cons in MVC architecture</figcaption></figure><p>Every architecture has its advantages and disadvantages. It is the same with the MVC architecture.</p><p><strong>Advantages of MVC architecture :</strong></p><ol><li>The development of the applications is super fast.</li><li>Easy for multiple developers to collaborate and work together.</li><li>Update the application is really easy.</li><li>Debugging made easier as we have multiple levels properly written in the application.</li><li>Offers the best support for test-driven development</li><li>Provides clean separation of concerns (SoC).</li><li>Search Engine Optimization (SEO) Friendly.</li><li>Suits more for apps that are done with large teams of web designers and developers<strong>.</strong></li></ol><p><strong>Disadvantages of MVC architecture :</strong></p><ol><li>MVC architecture is bit hard to understand</li><li>Must have strict rules on methods.</li><li>Knowledge of multiple technologies is required</li><li>Lots of code maintain in the controller</li></ol><p>When we come across the advantages, the disadvantages can be neglected since the disadvantages are not so huge when comparing to the advantages. In conclusion, MVC architecture provides lots of advantages where programmers are being benefited.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=124729732c67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is an “API”? Simply Explained!]]></title>
            <link>https://niroshanratnayake.medium.com/what-is-an-api-simply-explained-cdb8bfcfbb37?source=rss-29c320bbe975------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdb8bfcfbb37</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Niroshan Ratnayake]]></dc:creator>
            <pubDate>Sun, 14 Feb 2021 08:28:42 GMT</pubDate>
            <atom:updated>2021-02-15T17:56:18.035Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZeCOG0MQoMB2q1lyad-xw.jpeg" /></figure><p>If you are in the software industry this may not be an uncommon word at all! But for the beginners who are stepping into the technical arena, this may be a bit hard term to get from his/her first go. Without further due, will clarify the so-called term “API”.</p><p>What are these APIs? Exactly? And why were they created? Let me explain the problem with a simple non-technical example.</p><figure><img alt="Client asks for what they want and waiter do the rest" src="https://cdn-images-1.medium.com/max/1024/1*0T1-UM3OheYk_b2hN1QZlA.png" /><figcaption>Waiter-Client Interaction(Real-world example for API usage)</figcaption></figure><p>When you go to a restaurant and order some food, you interact with the waiter, you can order food and drinks, ask questions about the menu, request and pay the bill and much more. In this example, the waiter is shielding you from all the complicated stuff that happens behind the scenes. You don’t have to worry about stoves, ovens, dishes, managing stock or pouring drinks. He’s the interface between you and all of the services that a restaurant offers, giving you a way to interact with the restaurant while still shielding you from all the complexity behind the scenes. You understand the Client-Waiter interaction right? If the answer is YES, you are good to go. Which means the waiter can be seen as the API of the restaurant. And through this example, you intuitively understand why they are useful.</p><p><strong>Let&#39;s get into some techie stuff…</strong></p><p>The term API stands for <strong>Application Programmable Interface</strong>, and it’s a way for different programs to work together in various ways. There are many types of APIs and reasons why they are used. I’ll highlight four of them in the blog so that you will get all that they are capable of. Simply, APIs can be used to get access to data from third parties.</p><p>In the restaurant example, the waiter can give you information on the status of your order without you having to go to the kitchen yourself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*Cg8-Uy3x39Y05awzn77a4g.jpeg" /></figure><p>Another example would be a weather app on your phone. Google or Apple have not gone out and put temperature sensors all over the world. Instead, these apps use the API of a third party to retrieve weather predictions. Apple, for instance, is using the API of the Weather Channel. <strong><em>APIs allow different apps and services to exchange information</em></strong><em>.</em> These days, it’s hard to find a service that doesn’t have an API. There are APIs to look up recipes, lyrics, information on barcodes, zip codes, available parking spaces, public holidays, and so on and so forth. <strong><em>But aside from just accessing data APIs can also be used to hide complexity and perform tasks</em></strong>.</p><p>In the restaurant example, you don’t need to know how to prepare a perfect roll of sushi, you just order one.</p><p>Another example would be the operating systems on our computers and phones. App developers don’t have to worry about setting up a Wi-Fi connection, drawing shapes onto the screen to make a beautiful user interface, or how to talk to the various sensors like the accelerometer or GPS. No. Instead, the operating system gives developers a bunch of APIs that simplify all of this. If an app wants to show a button on the screen, it just asks the system to render one, the app doesn’t have to worry about what device it is running on what hardware it has screen resolution or anything like that. <strong><em>It makes developers more efficient because they can focus on what matters to them</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*mHB9hKdkJXp-3MzvHKk1EQ.png" /><figcaption>A high-level overview of how APIs work</figcaption></figure><p>But aside from accessing data, and abstracting complexity, APIs can also be used to extend functionality. For instance, iOS applications can show a widget in the Notification Center. And to do that the app notifies the system through an API that it has a widget available. If the user now adds this widget to their Notification Center, the system will contact the app and ask how would you display the widget.</p><p>Another example is Siri, google assistant or Alexa. These personal assistants are quite clever. But external developers can use the assistance API to extend the functionalities even further. My Google Home, for instance, didn’t know how to turn my smart outlets on or off. But that changed when the vendor integrated with the Google Assistant through its API. Suddenly, Google became aware of the new hardware, its capabilities and how to interact with it. You might not realize it, but APIs are all around us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*XUlLsifjI8NaNMHnhvGOnw.jpeg" /></figure><p>You’ve probably seen messages like these, “your phone asking for permission to use your location or microphone”. Did you noticed this with respect to the term API?.</p><p>This brings us to the final use case. <strong><em>APIs can be used as gatekeepers</em></strong>. For instance, on mobile platforms, the system only has a handful of APIs that can be used to get your location. And because it’s centralized in the system, it’s really easy for iOS or Android to notify you when an app is using your location. So it’s not the app that is being nice and asked your permission first. No, it’s the system that does it for them. There’s no way around it. What’s more, the system also gives the ability to revoke this permission and At a later time, should you change your mind. So every time your phone asks for your permission, you know that an app is using an API of the system, and one that is privacy-sensitive. And while this is great, there is an issue with this!!!. Usually, permission is only asked once, you might have used your Google or Facebook account to log into another website or app. It’s easy, fast and convenient. But by doing that, we also give the website or app the permission to access some of our data, like our name or email address. This is great because it puts us in control of our personal data. If you don’t want to share it, you just deny it. However, the problem here is that sometimes these permissions are long-lasting. And after a while, we forget what apps or websites we gave permission to access our data. This is what allowed Cambridge analytical to collect massive amounts of data through the Facebook API, they created a personality quiz that asked for permission to get some of your personal data. However, if you gave it permission, the app could silently access your data for months, even if you didn’t use it anymore. Instead, you had to revoke the permission through the Facebook website. So in short, APIs can act as gatekeepers protecting our personal data and only giving it out to the apps that we choose. But we should be aware of how long these permissions last and revoke them when we no longer use an app!!!.</p><p>So time to Sum all things up, APIs are all around us. There used to get access to data so that multiple apps or services can work together. They can also hide complexity for developers, allowing them not to waste time on figuring out how GPS works and etc. For instance, APIs can also be used to extend the functionality of existing systems. And finally, they can act as gatekeepers to protect our personal data. I hope my first very first blog brought some clarity to a topic that is mostly discussed among developers.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdb8bfcfbb37" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>