<?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 Kavindu Pathum Hewage on Medium]]></title>
        <description><![CDATA[Stories by Kavindu Pathum Hewage on Medium]]></description>
        <link>https://medium.com/@kavindupathumhewage?source=rss-4aedf3b9eab0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lLFBlq3MhMXJvntuU30vDA.jpeg</url>
            <title>Stories by Kavindu Pathum Hewage on Medium</title>
            <link>https://medium.com/@kavindupathumhewage?source=rss-4aedf3b9eab0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 14:05:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kavindupathumhewage/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[Dependency Injection in .NET Framework]]></title>
            <link>https://medium.com/@kavindupathumhewage/dependency-injection-in-net-framework-53704eeb7516?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/53704eeb7516</guid>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Wed, 27 Nov 2024 15:57:38 GMT</pubDate>
            <atom:updated>2024-11-27T15:57:38.661Z</atom:updated>
            <content:encoded><![CDATA[<h3>Dependency Injection in .NET Framework</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*Nd1aRAjjIfY8M0Xjb1xBVw.gif" /></figure><h4>Introduction</h4><p>In software development, managing dependencies effectively can make or break the maintainability of a project. This is where <strong>Dependency Injection (DI)</strong> comes to the rescue. DI is a <strong>design pattern</strong> that helps developers achieve <strong>Inversion of Control (IoC)</strong> by providing a class with its required dependencies from an external source, instead of creating them within the class itself.</p><p>In this blog, we’ll dive into the core concepts of DI, explore its implementation in the .NET Framework, and discuss best practices to make your applications more scalable, maintainable, and testable.</p><h4>Understanding the Basics</h4><p><strong>What Are Dependencies?</strong><br>Dependencies are objects or services that a class relies on to function. For example, a class might depend on a logging service or a database repository to perform its tasks.</p><p><strong>How Does Dependency Injection Work?</strong><br>DI provides a way to supply dependencies to a class. The three common types of DI are:</p><ol><li><strong>Constructor Injection</strong>: Dependencies are passed through a class constructor.</li><li><strong>Property Injection</strong>: Dependencies are set through public properties.</li><li><strong>Method Injection</strong>: Dependencies are provided as parameters to a method.</li></ol><h4>Dependency Injection in the .NET Framework</h4><p>Before .NET Core introduced built-in support for DI, developers used third-party DI containers like <strong>Unity</strong>, <strong>Autofac</strong>, and <strong>Ninject</strong> in the .NET Framework. Even without a DI container, you can implement DI manually to decouple your classes.</p><h4>Example: Manual Dependency Injection</h4><p>Here’s a simple example to understand DI without using a framework:</p><pre>public interface ILogger<br>{<br>    void Log(string message);<br>}<br><br>public class ConsoleLogger : ILogger<br>{<br>    public void Log(string message)<br>    {<br>        Console.WriteLine(message);<br>    }<br>}<br><br>public class ProductService<br>{<br>    private readonly ILogger _logger;<br><br>    public ProductService(ILogger logger)<br>    {<br>        _logger = logger;<br>    }<br><br>    public void Process()<br>    {<br>        _logger.Log(&quot;Processing product...&quot;);<br>    }<br>}<br><br>class Program<br>{<br>    static void Main(string[] args)<br>    {<br>        ILogger logger = new ConsoleLogger(); // Injecting the dependency<br>        ProductService productService = new ProductService(logger);<br>        productService.Process();<br>    }<br>}</pre><p>This example demonstrates <strong>Constructor Injection</strong>, where the ILogger dependency is passed into the ProductService class. The use of the ILogger interface ensures that the class remains loosely coupled.</p><h4>Using Dependency Injection Containers</h4><p>To simplify dependency management in larger applications, developers often use DI containers. These frameworks automate the injection process and manage the lifecycle of objects.</p><p><strong>Unity Example:</strong></p><pre>IUnityContainer container = new UnityContainer();<br>container.RegisterType&lt;ILogger, ConsoleLogger&gt;();<br><br>ProductService productService = container.Resolve&lt;ProductService&gt;();<br>productService.Process();</pre><p>Autofac Example:</p><pre>var builder = new ContainerBuilder();<br>builder.RegisterType&lt;ConsoleLogger&gt;().As&lt;ILogger&gt;();<br>builder.RegisterType&lt;ProductService&gt;();<br><br>using (var container = builder.Build())<br>{<br>    var productService = container.Resolve&lt;ProductService&gt;();<br>    productService.Process();<br>}</pre><h4>Advantages of Dependency Injection</h4><ol><li><strong>Loose Coupling</strong>: Reduces dependency between classes by relying on abstractions.</li><li><strong>Easier Testing</strong>: Facilitates unit testing by allowing mock dependencies.</li><li><strong>Centralized Configuration</strong>: Dependencies are configured in one place, improving maintainability.</li><li><strong>Object Lifecycle Management</strong>: DI containers can manage object scopes, such as Singleton, Transient, or Scoped.</li></ol><h3><strong>Best Practices for Dependency Injection</strong></h3><p><strong>Inject Interfaces, Not Concrete Classes</strong></p><p>Depend on abstractions to make the code more flexible and testable.</p><p><strong>Avoid Over-Injection</strong></p><p>Use DI Frameworks for Complex Applications</p><p><strong>Understand the Object Lifecycle</strong></p><p>Choose the appropriate lifecycle for your dependencies:</p><p>Singleton: One instance for the entire application.</p><p>Transient: A new instance for every request.</p><p>Scoped: One instance per scope.</p><h4>Conclusion</h4><p>Dependency Injection is a powerful design pattern that promotes clean, modular, and testable code. While it requires a learning curve, the benefits far outweigh the initial effort. In the .NET Framework, DI can be implemented manually or with the help of robust third-party containers like Unity and Autofac.</p><p>By following best practices and understanding the nuances of DI, you can write code that is easier to maintain and scale. As you transition to .NET Core, built-in DI support will further streamline the development process.</p><p>Start incorporating DI into your projects today, and experience the difference it makes!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53704eeb7516" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Problems encountered during the Application Framework module Group Project]]></title>
            <link>https://medium.com/@kavindupathumhewage/problems-encountered-during-the-application-framework-module-group-project-ad02fb539c83?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ad02fb539c83</guid>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Sat, 04 Jun 2022 15:26:20 GMT</pubDate>
            <atom:updated>2022-06-04T15:26:20.218Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tc2ULluoWhSFaX4A3VK0kA.jpeg" /></figure><p>While doing the project as a group and as individuals some common problems occurred.</p><p>Mern Stack was used as the language for the project development and most of everyone has not had much knowledge of the language. It was a bit hard to learn a new language and complete the project. It was taken a little long time to finalize a language and learn it to develop the project. We had to find free tutorials to learn the language. Github was used for version control and it was very difficult to be done because the members of the group had not a big knowledge of Github.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TRdTrfol0W0F-RQOZCeFig.png" /></figure><p>We had to learn it by referring to many tutorials to get an idea and understanding of Github. The most difficult part while doing the project was the hosting. For the project deployment and hosting Heroku was used. JWT was used for user authorizations. Test cases are still doing and it is very difficult and does not know to do that. For this project, we did not have a proper time management plan.</p><p>The reason for not having a proper time management plan was, that all the members are doing their internships and did not have time to communicate properly and share the information among all the members. It was hard to get time from everyone in the group at the same time. They did their parts whenever possible and completed the project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ad02fb539c83" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why is ReactJS Better for Enterprise Application Development?]]></title>
            <link>https://medium.com/@kavindupathumhewage/why-is-reactjs-better-for-enterprise-application-development-a5f46c54e0c5?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5f46c54e0c5</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[enterprise-software]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Sun, 15 May 2022 10:28:49 GMT</pubDate>
            <atom:updated>2022-05-15T10:28:49.446Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s5qbG2WIksaYVttb9FZ-zg.png" /></figure><p>Developers can create powerful and efficient content on the fly with ReactJS. ReactJS has risen to prominence among emerging and professional developers for both online and mobile app development in a short period of time. Let’s look at why. ReactJS is an open-source front-end JavaScript toolkit for creating fast and engaging user interfaces for online and mobile apps. Its source code may be tweaked and modified by developers to better suit project needs.</p><p>ReactJS also allows for the building of reusable user interface components and manages the “view” component of mobile and online apps. Simply said, ReactJS has a big impact on how an app looks and feels. ReactJS was created in 2013 by Jordan Walke, a Facebook software engineer. Since then, it’s been a one-stop shop for creating fast, dynamic, and user-friendly websites.</p><p>The utilization of ReactJS for corporate app development is dependent on a variety of factors. Among them are:</p><ol><li><strong>Market Accessibility in a Hurry</strong></li></ol><p>ReactJS provides speed and responsiveness as a bonus. This means that developing ReactJS applications takes far less time than developing other types of applications. Furthermore, features such as reusable ReactJS components and VDOM prevent a quality compromise. ReactJS is the ideal go-to solution for customers who want to launch their products quickly and efficiently. It saves time and improves quality.</p><p>2.<strong> For a Smooth and Simple Experience</strong></p><p>It’s not easy to put up with development tools. Even if they produce superior results, some tools contain several components that might be difficult to understand. ReactJS, on the other hand, is the polar opposite. It is quite smooth and simple to operate, and it can be used by both experts and trainees.</p><p><strong>3. For Long-Term Requirements</strong></p><p>Innovations that happen in the blink of an eye emphasize the existing situation. As a result, the immediate requirement is for a cost-effective solution that can be relied upon in the long run. ReactJS has gained a reputation for the simplicity of editing and constructing mobile applications, as well as distinct functioning protocols for online applications, that no other web development tool can match. As a result, it has already addressed the demand for an enterprise-wide web development solution.</p><p><strong>4. For Extraordinary Developing Needs</strong></p><p>ReactJS has a powerful design tool that aids in the fine-tuning of apps. It features browser-specific capabilities and allows for easy scaling of the hierarchy of the additional components.</p><p>ReactJS has piqued the interest of industry experts since its beginnings. Its positive results have set the bar for other development tools, as well as assisted in the transition from an experiment to a standard. The following are some notable ReactJS users:</p><ul><li>Netflix</li><li>Instagram</li><li>Facebook</li><li>Tesla</li></ul><p>Aside from these companies, ReactJS has been used by the BBC, PayPal, GitHub, ADroll, Uber, and Zendesk, and has helped them improve their operations.</p><h3><strong>When is ReactJS required in a project?</strong></h3><p>Despite the fact that ReactJS is simple to use, it is not appropriate for every project. For designing basic applications, conventional JavaScript is the best solution. ReactJS is a complex technology in and of itself. When it’s used with additional libraries like Redux or MobX, it becomes even more sophisticated.</p><p>It’s time to employ ReactJS or hire a ReactJS developer if your project has a lot of different states or components, such as zippy navigation items, open and closed parts, robust inputs and buttons, and user login. By utilizing precise and specialized information, ReactJS apps are properly balanced and successfully cope with these shifting conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*wZ_EBOcqO8kfGlOvCZIVzQ.png" /></figure><ul><li><strong>JSX Syntax Compatibility</strong></li></ul><p>ReactJS’ compliance with JSX syntax, in addition to being compatible with standard JavaScript, provides for increased speed. If the user is familiar with JSX, writing for ReactJS is simple and straightforward. After that, ReactJS takes care of converting the JSX codes into a usable format. It’s worth mentioning that JSX allows you to blend HTML and JavaScript without having to use separate template files.</p><ul><li><strong>React Native</strong></li></ul><p>Understanding ReactJS has the extra benefit of exposing you to React Native. This is a dedicated tool for creating ReactJS apps for mobile devices. The resulting mobile apps may simply transform written JavaScript into native code, which helps to give it a more thrilling and distinct appearance and feel.</p><ul><li><strong>Virtual DOM</strong></li></ul><p>The Virtual DOM component is responsible for a large portion of ReactJS’s performance. ReactJS effectively replicates the page’s DOM. It compares this replicated DOM to the original when any change occurs. Following that, just the modification is modified, causing the browser to re-render a tiny portion of the page rather than the complete page. As a result, ReactJS web apps are well-equipped to handle rapid updates.</p><ul><li><strong>Reusable Component</strong></li></ul><p>ReactJS is the foundation for building components that may be used at any moment and coupled with other components. As a consequence, time is saved because a feature may be reused several times without difficulty. It also accelerates the process of making modifications or updates to a component, as well as their simple sharing as the application grows.</p><ul><li><strong>Developer Tools and Support</strong></li></ul><p>ReactJS has a wide range of users and is actively supported by Facebook developers. Users can ask questions and seek help from the community at any time. Separate developer tools are also available for examining an application. Monitoring and cross-checking are made simple with these tools, ensuring correct operation and optimizing the app experience.</p><h3>The Top 10 Reasons to Use ReactJS</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*zt41glswuWmfLD4C6U0oJg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5f46c54e0c5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginning with understanding node.js.]]></title>
            <link>https://medium.com/@kavindupathumhewage/beginning-with-understanding-node-js-2118c8f76cf3?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/2118c8f76cf3</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Sun, 15 May 2022 09:25:01 GMT</pubDate>
            <atom:updated>2022-05-15T09:25:01.596Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*Brg1VRJdMrhRseKbVWfCbg.png" /></figure><p>Node.js, like many other technologies, has supporters and opponents. But there’s no doubting that it’s widely employed by several major services, such as Uber, LinkedIn, and PayPal — making it a force to be reckoned with regardless of which side of the issue you’re on. Popular technologies utilized by prominent brands are also something to consider while making professional decisions.</p><p>So, what is Node.js and how does it work? Node.js is a JavaScript runtime environment that is open source and cross-platform. The V8 JavaScript engine in Chrome parses and executes JavaScript code. Node has a fast and lightweight event-driven, non-blocking I/O paradigm. One of the primary reasons for Node’s popularity is its programming approach.</p><h3>Advantages of Learning Node.js</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QZ5rKyVmLFg4CfEA8oKb5g.png" /></figure><p><strong>1. Simple to Understand</strong></p><p>JavaScript is used to create Node. JavaScript is a widely-used programming language that almost every developer is familiar with. As a result, even a novice JavaScript coder may learn Node with minimal work and time.</p><p><strong>2. Js Full Stack</strong></p><p>Node is responsible for the emergence of full-stack web development. When a single developer works on all parts of a program, such as front-end development, back-end development, database management, and so on, this is known as full-stack web development. Full-stack engineers had to master numerous languages before Node. To create both front-end and back-end web apps using Node, you simply need to know JavaScript.</p><p><strong>3. Market Needs</strong></p><p>Full-stack developers are in great demand, and we’re seeing more and more job listings that need Node knowledge. As a result, including Node.js on your CV can help you further your career as a stack developer.</p><p><strong>4. Flexibility in App Development</strong></p><p>Node allows you a lot more freedom when it comes to constructing apps than Ruby on Rails, which has stringent limits and norms for designing software. A fresh Node installation simply includes the bare minimum, allowing you to build anything from the ground up with few limits.</p><p><strong>5. Active Community</strong></p><p>Node.js is an open-source framework with a thriving community of developers who are constantly contributing to its advancement.</p><h3>How to Start Learning Node.js</h3><p><strong>1. Understand JavaScript</strong></p><p>Because Node is built in JavaScript, you should begin by understanding the language. This includes knowledge of scopes, functions, closures, module patterns, classes, promises, and callbacks, as well as Strings, Numbers, Arrays, Objects, Sets, and Maps.</p><p><strong>2. Know Why It’s Called a Node</strong></p><p>You’ll have a better understanding of how it works after you understand why it’s named Node. It’s called Node because it’s used to create nodes, which are basic single-process units. These nodes may be grouped using good networking protocols for communication and scaled up to create massive distributed programs.</p><p><strong>3. Understand Node non-blocking.</strong></p><p>This is Node’s most important feature. You must grasp how asynchronous I/O operations are conducted in Node, with the lines of code following a non-blocking style.</p><ul><li>Give Node instructions to run (a function).</li><li>Provide parameters to the function.</li><li>With your function, send a callback to Node.</li><li>After yours, Node will take instructions from other lines.</li><li>Node will call your callback with the outcome of your function after it has been calculated.</li></ul><p><strong>4. Understand the Event Loop Concep</strong>t</p><p>A stack, a heap, and a queue are the three basic types of data structures. The queue is queried for the next message in a loop, and when one is found, the message’s callback is called.</p><p><strong>5. Become familiar with global variables</strong></p><p>In a Node REPL (read-eval-print-loop), type global to view all of the options. JavaScript, Node library functions, and Node global objects are all present. Learn how to utilize them for a variety of activities.</p><p><strong>6. Get to know the libraries that come with Node.js.</strong></p><p>You may use the libraries to learn how to use “net” to run a TCP server and program sockets, “fs” to read/write files, and “http” to operate a streaming-ready web server, among other things.</p><p><strong>7. Learn to code with Node.js.</strong></p><p>Read some of the code in a framework like “Express” and attempt to understand it. Reading in a group is significantly easier.</p><p><strong>8. Create a NodeJS web application without using any frameworks</strong></p><p>Handle as many scenarios as possible till you feel confident using Node.</p><h3>Let’s put these ideas into practice with some code…</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*-B-vw5OePMVaPm-FSxfoPw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2118c8f76cf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is MVC architecture?]]></title>
            <link>https://medium.com/@kavindupathumhewage/what-is-mvc-architecture-8e0d82f279c1?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e0d82f279c1</guid>
            <category><![CDATA[mvc]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[mvc-architecture]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[model-view-controller]]></category>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Sun, 15 May 2022 08:08:48 GMT</pubDate>
            <atom:updated>2022-05-15T08:08:48.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXx6X9gvIEr6MKNLxew8ig.png" /></figure><p>Model View Controller is a well-known software design pattern that may be applied to various frameworks and programming languages, including Python, Ruby, PHP, JavaScript, and others. It is widely used to create web and mobile applications.<br>MVC is a component of the architecture and its patterns are designed to handle different aspects of an application in development. These design pattern serves to separate the presentation layer from the business logic.</p><p><strong>Let‘s see why do developers care about MVC? </strong><br>It is popular in the app and web development, and it’s one of the most used software design patterns for app and web development.</p><p>The Model View Controller design pattern can be categorized into one of 3 buckets;<br>Model: stores &amp; manages data.<br>View: Graphical User Interface<br>Controller: Brains of the application.</p><p>The controller collects input from the view, uses logic to translate the input to a demand for the model, the model grabs the data, and the controller passes data from the model back to the view for the user to see in a nice display.</p><p><strong>The car driving mechanism can be considered as an example of the MVC model.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*iivSrm8LeT3syKH5sQMLlQ.png" /></figure><p>Every car consists of three main parts.<br><strong>View</strong>= User interface : (Gear lever, panels, steering wheel, brake, etc.)<br><strong>Controller</strong>- Mechanism (Engine)<br><strong>Model</strong>- Storage (Petrol or Diesel tank)<br>Car runs from the engine take fuel from storage, but it runs only using mentioned user interface devices.</p><h3>Advantages of MVC,</h3><ul><li>MVC benefits, are commonly utilized for graphical user interfaces (GUIs)</li><li>Frequently used in web applications</li><li>Client and server responsibilities are separated in MVC, which is suitable for web application design.</li><li>When it comes to development, MVC is a valuable design pattern.</li><li>Separation of Concerns: code is divided into three buckets based on its function: model, view, and controller.</li><li>It’s compatible with Ruby on Rails.</li><li>Loosely Coupled.</li><li>Unnecessary dependencies are removed.</li><li>Reusable without any changes.</li><li>Model classes are reused without modification thanks to MVC.</li><li>Reuse of code.</li><li>Adaptable code.</li><li>Cohesion is high.</li><li>Simpler to maintain or change.</li><li>Each component can be evaluated separately (Model, view, controller).</li><li>Supports Multiple perspectives.</li></ul><h3><strong>Disadvantages of MVC,</strong></h3><ul><li>It can be difficult to read, adapt to unit tests, and reuse these models at times.</li><li>Multiple programmers are required to run parallel programming.</li><li>Multiple technologies must be understood.</li><li>Because there are so many codes in the controller, maintenance is challenging.</li></ul><h3><strong>Conclusion:</strong></h3><p>The MVC architectural pattern splits an application into Models, each of which contains all of the data and logic associated with it.<br>The user sees the data through the view.<br>A controller is a component that connects the Model and View components and manages user interactions.<br>Trygve Reenskaug initially discussed MVC architecture in 1979.<br>It’s a framework that’s easy to test, extend, and plugin.<br>Rails, Zend Framework, CodeIgniter, Laravel, and Fuel PHP are some well-known MVC frameworks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e0d82f279c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Is The MERN Stack, and How Does It Work?]]></title>
            <link>https://medium.com/@kavindupathumhewage/what-is-the-mern-stack-and-how-does-it-work-ea12ef914cba?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea12ef914cba</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[mern-stack]]></category>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Thu, 17 Mar 2022 15:55:04 GMT</pubDate>
            <atom:updated>2022-03-17T15:55:04.688Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ehs2KFLc1bZNEonjSu2NMw.png" /></figure><h3>Introduction</h3><p>The desire and demand among users for a more enriching and seamless World Wide Web experience is higher than ever. As a result, in order to provide that enriching and seamless experience, developers will need to change their methods. Developers are now using advanced technology stacks like MERN and MEAN instead of traditional JavaScript and HTML-based methodologies.</p><h3>What is MERN Stack</h3><p>In the word MERN, there are four letters that stand for Mongo DB, Express.js,Rect.js, and Node.js. MERN Stack is a powerful technology stack that is based on JavaScript. It is a very easy faster and more comfortable deployment of full-stack web applications. Let’s have an idea about the components of MERN Stack and how they interact with each other.</p><h3>1. Mongo DB</h3><p>This is a non-relational document-oriented based database. And It’s an open-source, cross-platform. JSON-based flexible documents are used to store data by MongoDB. It allows the fast exchange of data between client and server. And even this increases the efficiency of data integration within applications. MongoDB is very easy to scale and it is known as a flexible database.</p><h3>2.Express.js</h3><p>This is a framework of Node. js. It manages the server and its routes. This improves the development process with more security. Express js is run on top of Node js.</p><h3>3.React.js</h3><p>React js is a JavaScript library that is open source. It was once used to create single-page application user interfaces. React.js dynamically loads the required components based on the user’s request (Virtual DOM). It also only has one page rather than multiple pages. The development process is made much easier and faster with React js. It saves time to be able to reuse react components.</p><h3>4.Node.js</h3><p>Node js is an open-source, cross-platform JavaScript run time environment. It is mainly built for Google Chrome. It is open-sourced by Google in 2008 which is built on Chrome’s v8 JavaScript engine. Node Package manager (NPM) is designed to run the JavaScript code outside the browser on the server which is accessed by Node js.</p><h3>What is the Interaction of the MERN Stack Components?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J7fBqFMtuUcEm5oqW_z5SA.png" /></figure><p>The MERN stack is used to develop applications that are deployed on three logical servers. The requests and responses are only handled by the server where the Node.js and Express.js based API resides; the browser cannot directly access the database server. For this API, most developers use REST or GraphQL architecture. The data in those requests and responses is formatted in JSON. Only that server can use database queries to communicate with the database server.</p><h3>MERN Stack’s Bonuses</h3><p>As I previously highlighted, the MERN stack is one of the most powerful tech stacks obtainable for full-stack development today, thanks to MongoDB’s scalability and speed, React.js’ responsiveness, and high performance, and the speed improvement provided by Express.js for Node.js.</p><p>· Cost-effective</p><p>· SEO friendly<strong> (</strong>Search Engine Optimization<strong>)</strong></p><p>· Enhanced performance</p><p>· Provides more security</p><p>· Provide the fastest delivery</p><p>· Provides faster Modifications</p><p>· Open Source</p><p>· Easy to switch between client and server</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea12ef914cba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principles]]></title>
            <link>https://medium.com/@kavindupathumhewage/solid-principles-d596e812b8f8?source=rss-4aedf3b9eab0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d596e812b8f8</guid>
            <dc:creator><![CDATA[Kavindu Pathum Hewage]]></dc:creator>
            <pubDate>Sat, 26 Feb 2022 09:49:28 GMT</pubDate>
            <atom:updated>2022-02-26T09:49:28.918Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsiLviiwPiwNjVCjpkWpig.png" /></figure><ul><li>Single Responsibility Principle (SRP)</li><li>Open-Closed Principle (OCP)</li><li>Liskov Substitution Principle (LSP)</li><li>Interface Segregation Principle (ISP)</li><li>Dependency Inversion Principle (DIP)</li></ul><h3><strong>Single Responsibility Principle (SRP)</strong></h3><p>According to the single responsibility principle, each class must perform only one function. Multiple functionalities in a single class mashup the code, and any changes made to the code may affect the entire class. The code is accurate, and it can be easily maintained.</p><h4>Benefits:</h4><p><strong>Testing</strong>: A class with only one responsibility will have far fewer test cases than a class with multiple responsibilities.<br><strong>Lower coupling</strong>: When a single class has less functionality, it has fewer dependencies.<br><strong>Organization</strong>: Searching is easier in smaller, well-organized classes than in monolithic ones.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*kcgQJjdAIbgo8o72SRr2Nw.jpeg" /></figure><h3><strong>Open-Closed Principle (OCP)</strong></h3><p>The methods, functions, variables, and so on are all part of the application or module. According to the open-closed principle, a module should be open for extension but closed for modification as new requirements arise. We can use the extension to add new functionality to the module.</p><h4>Benefits:</h4><p>Reduces the need to modify source code after it has been written, tested, and debugged.<br>Reduce the likelihood of new bugs being introduced into existing code.<br>Increased flexibility and reduced coupling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IvOHr-X32Mxs2hbwTdIl6w.jpeg" /></figure><h3><strong>Liskov Substitution Principle (LSP)</strong></h3><p>Barbara Liskov proposed the Liskov Substitution Principle (LSP). It applies to inheritance in the sense that derived classes must be 100% interchangeable with their base classes. To put it another way, if class A is a subtype of class B, we should be able to replace B with A without affecting the program’s behavior.</p><p>It goes beyond the open-close principle to look at how a superclass and its subtypes behave. Unless there is a compelling reason to do otherwise, we should design the classes to preserve the property.</p><h3>Benefits:</h3><ol><li>Code becomes clear.</li><li>Reduce the complexity and much easier to debug.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*FakPUr_xlKEHx9Aup5QTBw.png" /></figure><h3><strong>Interface Segregation Principle (ISP)</strong></h3><p>According to the principle, larger interfaces split into smaller ones. Because only the methods that are required are used in the implementation classes. We should not force the client to use methods that they do not wish to use.</p><p>The interface segregation principle aims to achieve the same goal as the single responsibility principle.</p><h3>Benefits:</h3><ol><li>Minimize dependencies on unused members.</li><li>Reducing coupling.</li><li>smaller interfaces are easier to implement.</li><li>improve flexibility and the possibility of reuse.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*jxJaHI6JZlUz6lBsGriASA.png" /></figure><h3><strong>Dependency Inversion Principle (DIP)</strong></h3><p>State that high-level modules should not depend upon low-level modules. they should depend on abstraction. Abstraction should not depend on details, details should depend upon abstraction.</p><ul><li>The idea is that we isolated our class behind an abstraction-created boundary. It is dependent on.</li><li>One class is still safe if all the details behind those abstractions change.</li></ul><h3>Benefits:</h3><ol><li>Keep coupling low.</li><li>Make design easier to change.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*KQ_83pyI3KrQ5rJD2kCOsw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d596e812b8f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>