<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amburi Roy</title>
    <description>The latest articles on DEV Community by Amburi Roy (@amburi).</description>
    <link>https://dev.to/amburi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1129325%2F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png</url>
      <title>DEV Community: Amburi Roy</title>
      <link>https://dev.to/amburi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amburi"/>
    <language>en</language>
    <item>
      <title>Scalability: Vertical, Horizontal, and Hybrid Scaling</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 22 Jan 2024 10:39:14 +0000</pubDate>
      <link>https://dev.to/amburi/scalability-vertical-horizontal-and-hybrid-scaling-5hkh</link>
      <guid>https://dev.to/amburi/scalability-vertical-horizontal-and-hybrid-scaling-5hkh</guid>
      <description>&lt;p&gt;&lt;strong&gt;Vertical Scaling&lt;/strong&gt; or &lt;strong&gt;Scale-Up&lt;/strong&gt; means adding more power (CPU, RAM, etc.) to your servers. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Horizontal scaling&lt;/strong&gt; or &lt;strong&gt;Scale-Out&lt;/strong&gt; allows you to scale by adding more servers to your pool of resources.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Vertical Scaling (Scale-Up):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When to Use:&lt;/strong&gt; Typically employed when the traffic is low.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why Use:&lt;/strong&gt; Simplicity is a key advantage. It involves adding more resources (CPU, RAM, etc.) to existing servers to handle increased load.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limitations:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Finite Scalability:&lt;/strong&gt; It's not possible to scale up infinitely due to hardware limitations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Point of Failure:&lt;/strong&gt; If the single server hosting your application fails, the entire system might go down.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Solution to Limitations: Horizontal Scaling (Scale-Out):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;When to Use:&lt;/strong&gt; Especially useful when the system needs to handle a higher volume of traffic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why Use:&lt;/strong&gt; Involves adding more servers to distribute the load, providing better fault tolerance and scalability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Redundancy:&lt;/strong&gt; Multiple servers distribute the load, reducing the risk of a single point of failure.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Easier to scale by adding more servers horizontally.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Challenges:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complexity:&lt;/strong&gt; Managing multiple servers can be more complex than a single, powerful server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; Scaling out might involve more initial setup costs.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Choosing Between Vertical and Horizontal Scaling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consideration Factors:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; Vertical scaling may become more expensive as you reach hardware limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility:&lt;/strong&gt; Horizontal scaling provides more flexibility to adapt to changing workloads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Redundancy:&lt;/strong&gt; Horizontal scaling offers better redundancy.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;strong&gt;Hybrid Scaling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Combined Approach:&lt;/strong&gt; In many cases, a combination of vertical and horizontal scaling is used to achieve optimal performance and efficiency. Increasing the resources of individual servers (vertical scaling) and adding more servers (horizontal scaling) when necessary.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Understanding the trade-offs and choosing the right scaling strategy depends on factors like the nature of your application, traffic patterns, budget constraints, and more.&lt;/p&gt;

</description>
      <category>scalability</category>
      <category>systemdesign</category>
      <category>verticalscaling</category>
      <category>horizontalscaling</category>
    </item>
    <item>
      <title>Cool Tool: ASDF — A single solution for managing versions</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Sun, 21 Jan 2024 02:08:08 +0000</pubDate>
      <link>https://dev.to/amburi/cool-tool-asdf-a-single-solution-for-managing-versions-4bcd</link>
      <guid>https://dev.to/amburi/cool-tool-asdf-a-single-solution-for-managing-versions-4bcd</guid>
      <description>&lt;p&gt;There are various version management tools and managers employed in the software development industry, each tailored to specific programming languages or frameworks. Here are some popular version managers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;NVM (Node Version Manager):&lt;/strong&gt; NVM serves as a version manager for Node.js, allowing developers to easily switch between different versions of Node.js.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;RVM (Ruby Version Manager):&lt;/strong&gt; RVM is a version manager designed for the Ruby programming language. It enables developers to handle multiple Ruby environments on the same machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Pyenv:&lt;/strong&gt; Pyenv functions as a Python version manager, simplifying the installation and management of different Python versions and facilitating easy switching between them.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, the version manager I consider the best is &lt;strong&gt;ASDF (Another System Definition Facility)&lt;/strong&gt;. ASDF is a versatile version manager that transcends traditional boundaries, offering a unified approach to version control for a diverse range of programming languages and tools. With ASDF, developers can say goodbye to the hassle of juggling different version managers for each language or framework.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;One of ASDF's key strengths lies in its seamless integration with various ecosystems.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>tooling</category>
      <category>versionmanager</category>
      <category>asdf</category>
      <category>cooltool</category>
    </item>
    <item>
      <title>Monolith, Microservices, Mono-Repo</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Sun, 21 Jan 2024 02:00:42 +0000</pubDate>
      <link>https://dev.to/amburi/monolithic-microservices-and-mono-repo-architecture-4o33</link>
      <guid>https://dev.to/amburi/monolithic-microservices-and-mono-repo-architecture-4o33</guid>
      <description>&lt;h2&gt;
  
  
  What is a Monolith?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Monolith&lt;/strong&gt; is a single, self-contained software application or system containing all the necessary code and data to perform its functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the problem in Monolith?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lack of Scalability:&lt;/strong&gt; Monoliths can be challenging to scale because all components are tightly coupled, making it difficult to scale specific functionalities independently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limited Agility:&lt;/strong&gt; Making changes or updates to a monolithic application can be slow and risky, as a single codebase may require extensive testing and downtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintenance Complexity:&lt;/strong&gt; As monolithic applications grow, they become increasingly complex and challenging to maintain, leading to higher maintenance costs and longer development cycles.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology Lock-In:&lt;/strong&gt; Monoliths often use specific technologies and frameworks, making adopting new technologies or tools difficult without major rewrites.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lessened Fault Isolation:&lt;/strong&gt; A failure in one part of a monolithic application can affect the entire system, making it harder to isolate and address issues without impacting the entire service.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How do you solve those problems?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Microservices&lt;/strong&gt; is an architectural approach in software development where a complex application is decomposed into independently deployable, small, and loosely coupled services that communicate over networks, promoting flexibility and scalability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Microservices allow individual components or services to be scaled independently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agility:&lt;/strong&gt; Microservices are smaller, decoupled services that make it easier to add new features, fix bugs, and update code without affecting the entire system, reducing the risk of errors and downtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintenance:&lt;/strong&gt; With microservices, each service has its own codebase and development teams to focus on specific requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Technology Diversity:&lt;/strong&gt; Microservices enable the use of different technologies, languages, and frameworks for each service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fault Isolation:&lt;/strong&gt; Since Microservices are loosely coupled codebases, if one service fails or experiences issues, it typically doesn't affect other services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's the problem with Microservices that the Mono repo solved?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Mono Repo&lt;/strong&gt; is a software development practice where all the source code for multiple projects or components of a software application is stored in a single, unified version control repository. In a monorepo, code for different services, libraries, or modules is organized and managed together rather than split into separate repositories as in a traditional multi-repo setup. This approach can simplify code sharing, version control, and dependency management across the various parts of a software project.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The charm of the Mono repo is to bring several loosely coupled code bases into one place and make it easily manageable.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0osohy9l5ppj9nzcd4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0osohy9l5ppj9nzcd4r.png" alt="Monolithic, Microservices and Mono Repo Architecture"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Complexity:&lt;/strong&gt; (out of sight, out of mind) Microservices manage numerous codebases, dependencies, and deployment pipelines, leading to increased complexity. A monorepo simplifies code management by consolidating all code into a single repository, making tracking changes, managing dependencies, and maintaining consistency easier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versioning and Dependency Hell:&lt;/strong&gt; Coordinating versions and dependencies across multiple microservices can be challenging. A monorepo allows for centralized version control and simplified dependency management, reducing the risk of version conflicts and compatibility issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Testing and Integration:&lt;/strong&gt; Integration testing between microservices can be complex and time-consuming. A monorepo enables more straightforward integration testing since all components reside in the same codebase, simplifying the testing process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Sharing and Reusability:&lt;/strong&gt; A monorepo facilitates code sharing and reusability across different application parts, promoting efficient development practices and reducing code duplication.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Advantages:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Easy Collaboration:&lt;/strong&gt; All code is in one place, making it easier for developers to work together on different projects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy Grant Access:&lt;/strong&gt; It's easy to give developers access to the code they need without worrying about managing multiple repositories. Easy to understand boundaries, which is who's responsibility – If you decide to create reports based on which team owns it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Understand Boundaries:&lt;/strong&gt; It's easy to see who is responsible for which code because everything is in one place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clone One Repo:&lt;/strong&gt; Developers only need to clone one repository, which simplifies their workflow. However, individual cloning could also be done in one directory. In that case, you all have to follow which branch you are currently in actively. In case of any changes that can potentially have lots of changes in several repositories, it could be not easy to track. In that way, mono repo could be a bright and shining option.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Simplified Dependency Management:&lt;/strong&gt; It's easy to manage dependencies in a monorepo because everything is in one place. Also, shared dependency management has a huge advantage — it solves the problem of incompatible or not matching versions. It's straightforward to manage dependency in the mono repo – because you can put everything in one place and share that in several projects. Imagine only one composer.json shared by rosetta and every Erasys PHP library. That would be simplified.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy Refactoring:&lt;/strong&gt; Monorepos make it easier to refactor code because developers can see all of the code affected by their changes. This can help to reduce the risk of introducing bugs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discovery:&lt;/strong&gt; It can be easy to discover code in a large monorepo. Other than that, discovery and searching could be done in GitLab&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Disadvantages
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Coupling:&lt;/strong&gt; If not managed carefully, a monorepo can lead to tight coupling between different projects. However, “Clone one repo” brings a problem that rosetta and other PHP libraries would be a bit coupled. If you didn't consider the subsequent feature integration, you might gradually tighten the coupling between libraries, eventually bringing the issues with Monolith. The problem is when the sprint is not focused on a single goal – Which is very usual. Also, systematic rebasing and conflict resolution could be induced in the mono repo in daily practice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;More Complex CI/CD Pipelines:&lt;/strong&gt; Pipelines must be intelligent enough to know which tests should be executed and what should be built.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance:&lt;/strong&gt; Monorepos can be slow and challenging to build and test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloning a Huge Repository:&lt;/strong&gt; Monorepos can be very large, making it slow and difficult for developers to clone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broken Master Situation:&lt;/strong&gt; If the master branch of a monorepo is broken, it can prevent developers from releasing new features or bug fixes. Suppose something is broken in the master; 2 developers are working on that, and one is ready to deploy a new feature in another project. Which should go first? Is it okay to merge a new feature on a broken master? Potentially, a broken master can put a hold on releasing a feature because those 2 repositories are not in one mono repo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Review Becomes Crucial:&lt;/strong&gt; It's important to have good tooling in place to manage a monorepo effectively. This can include tools for dependency management, code review, and continuous integration and delivery.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All these problems are not unsolvable, but you might need to change quite a bit of our existing system to accommodate the Mono repo.&lt;/p&gt;

</description>
      <category>microservices</category>
      <category>monolith</category>
      <category>monorepo</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Most commonly used Git command shortcuts</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Sun, 21 Jan 2024 01:57:26 +0000</pubDate>
      <link>https://dev.to/amburi/most-commonly-used-git-command-shortcuts-nck</link>
      <guid>https://dev.to/amburi/most-commonly-used-git-command-shortcuts-nck</guid>
      <description>&lt;p&gt;I often rely on a set of Git command shortcuts that are widely used and find them quite convenient. Admittedly, it took me some time initially to become accustomed to them.&lt;/p&gt;

&lt;h3&gt;
  
  
  List of shortcuts:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;alias g='git'&lt;/code&gt; — Simplifies the Git command as 'g'.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gs='git status'&lt;/code&gt; — Quickly check the current Git repository status.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias ga='git add'&lt;/code&gt; — Prepares changes for the next commit.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gaa='git add .'&lt;/code&gt; — Adds all changes in the working directory to the staging area.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gc='git commit -m'&lt;/code&gt; — Commits changes with a specified commit message.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gca='git commit -am'&lt;/code&gt; — Adds and commits all changes in one step with a commit message.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gco='git checkout'&lt;/code&gt; — Switches to a different branch or commit.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gcb='git checkout -b'&lt;/code&gt; — Creates and switches to a new branch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gbd='git branch -d'&lt;/code&gt; — Deletes a specified branch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gba='git branch -a'&lt;/code&gt; — Lists all branches, including remote branches.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gbr='git branch'&lt;/code&gt; — Lists local branches.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gpl='git pull'&lt;/code&gt; — Fetches changes from a remote repository and merges them into the current branch.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gph='git push'&lt;/code&gt; — Pushes changes to the remote repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gpho='git push origin'&lt;/code&gt; — Pushes changes to the 'origin' remote repository.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gl='git log --oneline'&lt;/code&gt; — Displays a simplified log of commits.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias gla='git log --oneline --decorate --graph --all'&lt;/code&gt; — Displays a detailed and graphical log of all commits.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitcommands</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Does Status Code `405` occur during a `GET` request?</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 09 Oct 2023 13:30:58 +0000</pubDate>
      <link>https://dev.to/amburi/does-status-code-405-occur-during-a-get-request-345c</link>
      <guid>https://dev.to/amburi/does-status-code-405-occur-during-a-get-request-345c</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Status Code 405: It indicates that the HTTP method used in the request is not allowed for the requested resource.&lt;/li&gt;
&lt;li&gt;GET Requests: A 405 status code should not occur during a standard HTTP GET request, as GET is meant for retrieving resources and is widely supported by web servers.&lt;/li&gt;
&lt;li&gt;Exceptions: Server behavior can vary, so there might be situations where a GET request receives a 405 status code due to server configuration or resource constraints.&lt;/li&gt;
&lt;li&gt;Advice: If you encounter a 405 status code for a GET request, investigate server configuration and consult API documentation to ensure correct usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What does status code 405 mean?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405"&gt;A status code of 405 typically indicates that the HTTP method used in the request is not allowed for the requested resource.&lt;/a&gt; In most cases, it's associated with HTTP methods like POST, PUT, DELETE, or PATCH being used on a resource that only allows GET requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Status Code &lt;code&gt;405&lt;/code&gt; occur during a &lt;code&gt;GET&lt;/code&gt; request?
&lt;/h2&gt;

&lt;p&gt;For a standard HTTP GET request, a status code of 405 should not occur unless there's a misconfiguration or an unusual server setup. GET requests are typically used for retrieving resources and are widely supported by web servers for most resources.&lt;/p&gt;

&lt;p&gt;However, it's important to note that server behaviour can vary, and there might be situations where a specific server or API returns a 405 status code for a GET request due to its configuration or the specific constraints of the resource. In such cases, it's essential to consult the API documentation or server documentation to understand the reasons for this response and how to use the API correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;Typically RESTful APIs and web services, a 405 status code for a GET request is not expected behaviour. If you encounter such a situation, it's a good idea to investigate the server configuration and consult the API documentation to ensure that you are making the correct request.&lt;/p&gt;

</description>
      <category>httpstattuscode</category>
      <category>statuscode</category>
      <category>405</category>
      <category>getrequest</category>
    </item>
    <item>
      <title>Does Status Code `405` occur during a `GET` request?</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 09 Oct 2023 13:30:31 +0000</pubDate>
      <link>https://dev.to/amburi/does-status-code-405-occur-during-a-get-request-ikm</link>
      <guid>https://dev.to/amburi/does-status-code-405-occur-during-a-get-request-ikm</guid>
      <description>&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Status Code 405: It indicates that the HTTP method used in the request is not allowed for the requested resource.&lt;/li&gt;
&lt;li&gt;GET Requests: A 405 status code should not occur during a standard HTTP GET request, as GET is meant for retrieving resources and is widely supported by web servers.&lt;/li&gt;
&lt;li&gt;Exceptions: Server behaviour can vary, so there might be situations where a GET request receives a 405 status code due to server configuration or resource constraints.&lt;/li&gt;
&lt;li&gt;Advice: If you encounter a 405 status code for a GET request, investigate server configuration and consult API documentation to ensure correct usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What does status code 405 mean?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405"&gt;A status code of 405 typically indicates that the HTTP method used in the request is not allowed for the requested resource.&lt;/a&gt; In most cases, it's associated with HTTP methods like POST, PUT, DELETE, or PATCH being used on a resource that only allows GET requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Does Status Code &lt;code&gt;405&lt;/code&gt; occur during a &lt;code&gt;GET&lt;/code&gt; request?
&lt;/h2&gt;

&lt;p&gt;For a standard HTTP GET request, a status code of 405 should not occur unless there's a misconfiguration or an unusual server setup. GET requests are typically used for retrieving resources and are widely supported by web servers for most resources.&lt;/p&gt;

&lt;p&gt;However, it's important to note that server behaviour can vary, and there might be situations where a specific server or API returns a 405 status code for a GET request due to its configuration or the specific constraints of the resource. In such cases, it's essential to consult the API documentation or server documentation to understand the reasons for this response and how to use the API correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;Typically RESTful APIs and web services, a 405 status code for a GET request is not expected behaviour. If you encounter such a situation, it's a good idea to investigate the server configuration and consult the API documentation to ensure that you are making the correct request.&lt;/p&gt;

</description>
      <category>httpstattuscode</category>
      <category>statuscode</category>
      <category>405</category>
      <category>getrequest</category>
    </item>
    <item>
      <title>Design Principles</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 11:42:26 +0000</pubDate>
      <link>https://dev.to/amburi/design-principles-d0</link>
      <guid>https://dev.to/amburi/design-principles-d0</guid>
      <description>&lt;p&gt;Design principles are fundamental guidelines and concepts that help guide the creation and evaluation of products, systems, or solutions. They are essential for various fields, including graphic design, web design, industrial design, architecture, and more.&lt;/p&gt;

&lt;p&gt;Software design principles are a &lt;strong&gt;set of guidelines that help developers to make a good system design&lt;/strong&gt;. There are 8 design principles,&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/kiss-keep-it-simple-stupid-fnh" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;💋 KISS (Keep It Simple, Stupid)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#kiss&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#keepitsimpleandstupid&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/dry-dont-repeat-yourself-2h78" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🧺 DRY (Don’t Repeat Yourself)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#dry&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#softwaredevelopment&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/yagni-you-arent-gonna-need-it-1n9i" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;YAGNI (You Aren't Gonna Need It)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#yagni&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#softwaredevelopment&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principles-3jpo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;🪨 SOLID Principles&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#softwareengineering&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SRP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-single-responsibility-principle-srp-4bfm"&gt;Single Responsibility Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principal-open-closed-principle-ocp-doe"&gt;Open-Closed Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LSP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-liskov-substitution-principle-lsp-1pco"&gt;Liskov Substitution Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ISP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-interface-segregation-principle-isp-bbf"&gt;Interface Segregation Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DIP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-dependency-inversion-principle-dip-1cpk"&gt;Dependency Inversion Principle&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why should we follow design principles?
&lt;/h2&gt;

&lt;p&gt;Design principles serve several crucial purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User-Centeredness&lt;/strong&gt;: They help ensure that the end product or solution meets the needs and expectations of the users. Following design principles can enhance usability and user satisfaction.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Consistency&lt;/strong&gt;: Design principles promote consistency in the design, which can lead to a more cohesive and professional-looking end result. Consistency aids users in understanding and navigating the product.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Problem Solving&lt;/strong&gt;: They provide a structured approach to solving design problems. When designers follow these principles, they are more likely to come up with effective and aesthetically pleasing solutions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Communication&lt;/strong&gt;: Design principles serve as a common language for designers, allowing them to communicate and collaborate effectively. They help convey design ideas and intentions to team members and stakeholders.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Efficiency&lt;/strong&gt;: By adhering to design principles, designers can work more efficiently. They don't have to reinvent the wheel for each design project but can instead rely on established guidelines.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Aesthetics&lt;/strong&gt;: Design principles often contribute to the overall visual appeal and aesthetics of a product or design. They can help create a harmonious and attractive appearance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How do we keep these principles in mind?
&lt;/h2&gt;

&lt;p&gt;To keep design principles in mind during a project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Research&lt;/strong&gt;: Understand the specific design principles that are relevant to your field or project. Familiarize yourself with best practices and examples.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Plan&lt;/strong&gt;: Incorporate design principles into your initial project planning and brainstorming. Identify which principles are most relevant to your project's goals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Prototyping&lt;/strong&gt;: Create prototypes or drafts that reflect the design principles you want to follow. This helps you visualize how they will be applied.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feedback&lt;/strong&gt;: Seek feedback from peers or stakeholders, specifically addressing how well the design adheres to the chosen principles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Iteration&lt;/strong&gt;: Be prepared to iterate and refine your design based on feedback and your evolving understanding of the principles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt;: Test your design with real users if possible to ensure that it meets their needs and expectations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Documentation&lt;/strong&gt;: Document the design principles you've followed and how they were applied. This can serve as a reference for yourself and others involved in the project.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How do you understand the principles?
&lt;/h2&gt;

&lt;p&gt;Understanding design principles requires both study and practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Education&lt;/strong&gt;: Start by studying design principles through books, online courses, tutorials, or formal education in design-related fields.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Analysis&lt;/strong&gt;: Examine existing designs, whether they are websites, products, or other creations. Analyze how design principles are applied in these examples.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practice&lt;/strong&gt;: Apply the principles in your own design projects. Practice is essential for gaining a deeper understanding of how to use design principles effectively.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Feedback&lt;/strong&gt;: Seek feedback from experienced designers or mentors who can help you refine your understanding of design principles.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Stay Updated&lt;/strong&gt;: Keep up with the latest trends and developments in your field, as design principles can evolve over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Experiment&lt;/strong&gt;: Don't be afraid to experiment with design principles. Sometimes, breaking the rules can lead to innovative and creative solutions.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;Ultimately, a combination of theoretical knowledge and practical experience will help you develop a strong understanding of design principles and how to apply them effectively in your work.&lt;/p&gt;

</description>
      <category>design</category>
      <category>designprinciples</category>
      <category>architecture</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>💋 KISS (Keep It Simple, Stupid)</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 11:36:12 +0000</pubDate>
      <link>https://dev.to/amburi/kiss-keep-it-simple-stupid-fnh</link>
      <guid>https://dev.to/amburi/kiss-keep-it-simple-stupid-fnh</guid>
      <description>&lt;p&gt;KISS stands for "Keep It Simple, Stupid." &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It suggests that simplicity should be a primary goal when designing systems, solutions, or products. &lt;/li&gt;
&lt;li&gt;The principle encourages avoiding unnecessary complexity, intricacies, or overengineering.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Goal:
&lt;/h2&gt;

&lt;p&gt;The primary goal of KISS is to promote simplicity in design and decision-making. It encourages developers, designers, and decision-makers to favor straightforward and easy-to-understand solutions over complex ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ease of Understanding&lt;/strong&gt;: Simple designs are easier to understand, reducing the cognitive load on developers and users. This leads to improved maintainability and troubleshooting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reduced Errors&lt;/strong&gt;: Simple systems are less prone to errors, making them more reliable and easier to test.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Faster Development&lt;/strong&gt;: Simplicity often leads to faster development and reduced time-to-market.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lower Maintenance Costs&lt;/strong&gt;: Simple designs are easier and cheaper to maintain over the long term.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Simple systems can often be scaled more easily, as they have fewer interconnected components to manage.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantages:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Misinterpretation&lt;/strong&gt;: The principle can be misinterpreted as advocating for shortcuts or lack of necessary sophistication in certain situations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context-Dependent&lt;/strong&gt;: What is considered "simple" can vary depending on the context and requirements of a project. What is simple for one project may be too complex for another.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  📌 Dependency Hell
&lt;/h2&gt;

&lt;p&gt;Dependency hell is a term used to define the problems faced by software developers, publishers, and users in general when a software or a software package is dependent on other software. Dependency hell occurs when software works abnormally or displays errors and bugs due to an integrated software/application/dependencies developed by a third party.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;KISS, or "Keep It Simple, Stupid," is a design principle that emphasizes the importance of simplicity in design and decision-making. Its goal is to promote straightforward and easy-to-understand solutions, leading to advantages such as improved understanding, reduced errors, faster development, lower maintenance costs, and scalability. However, it should be applied judiciously, as overly simplistic solutions may not be suitable for all contexts or requirements.&lt;/p&gt;

</description>
      <category>kiss</category>
      <category>keepitsimpleandstupid</category>
      <category>architecture</category>
      <category>designpatterns</category>
    </item>
    <item>
      <title>YAGNI (You Aren't Gonna Need It)</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 11:22:29 +0000</pubDate>
      <link>https://dev.to/amburi/yagni-you-arent-gonna-need-it-1n9i</link>
      <guid>https://dev.to/amburi/yagni-you-arent-gonna-need-it-1n9i</guid>
      <description>&lt;p&gt;&lt;strong&gt;YAGNI&lt;/strong&gt; stands for "You Aren't Gonna Need It." &lt;/p&gt;

&lt;p&gt;YAGNI (You Aren't Gonna Need It) is a software development principle that suggests not adding functionality or code until it is deemed necessary. &lt;/p&gt;

&lt;p&gt;It encourages developers to avoid premature optimization, overengineering, or speculative features.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: It basically means that you should not write the same code/configuration in multiple places. If you do that, then you’ll have to keep them in sync; and any changes to the code at one place will require changes at other places as well. &lt;/p&gt;

&lt;h2&gt;
  
  
  Goal:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The primary goal of YAGNI is to avoid unnecessary complexity and wasted effort by focusing on delivering only what is essential to meet the immediate requirements and needs of the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advantages:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Simplicity&lt;/strong&gt;: YAGNI promotes simple and straightforward code by discouraging unnecessary features and complexity. This leads to code that is easier to understand and maintain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduced Waste&lt;/strong&gt;: By avoiding the implementation of features that may never be used, YAGNI reduces the waste of development time and resources on unnecessary work.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt;: YAGNI allows a project to remain flexible and adaptable to changing requirements because it does not commit resources to speculative features.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Disadvantages:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Overlooked Future Needs&lt;/strong&gt;: In some cases, YAGNI might lead to overlooking legitimate future requirements. It's essential to strike a balance between avoiding unnecessary work and anticipating potential future needs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Team Communication&lt;/strong&gt;: Misunderstanding or miscommunication within a development team can lead to disagreements about what is considered "necessary" or "unnecessary."&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;YAGNI is a pragmatic software development principle that encourages developers to resist the temptation to add features, optimizations, or code that is not currently required by the project. It promotes simplicity, reduces waste, and keeps projects adaptable. However, it should be applied judiciously, taking into account the potential for future needs and ensuring clear communication within the development team.&lt;/p&gt;

</description>
      <category>yagni</category>
      <category>designpatterns</category>
      <category>architecture</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>🧺 DRY (Don’t Repeat Yourself)</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 10:58:47 +0000</pubDate>
      <link>https://dev.to/amburi/dry-dont-repeat-yourself-2h78</link>
      <guid>https://dev.to/amburi/dry-dont-repeat-yourself-2h78</guid>
      <description>&lt;p&gt;DRY stands for "Don't Repeat Yourself." It is a principle that encourages developers to avoid duplicating code or logic in their software systems.&lt;/p&gt;

&lt;p&gt;📌 This principle states that each small piece of knowledge (code) may only occur exactly once in the entire system. This helps us to write scalable, maintainable, and reusable code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Goal:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The DRY principle aims at reducing the repetition of code and effort in software systems.&lt;/li&gt;
&lt;li&gt;The DRY principle promotes reusability. It makes the code more maintainable, more extensible, and less buggy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Advantages:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code Maintainability&lt;/strong&gt;: DRY code is easier to maintain because there's only one place to make updates or fixes when needed. This reduces the risk of inconsistencies or bugs introduced by changes in multiple locations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improved Readability&lt;/strong&gt;: DRY code is often more readable and comprehensible because it minimizes redundancy. Developers can understand and modify the codebase more easily.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enhanced Efficiency&lt;/strong&gt;: Reusing code reduces the development effort. Instead of writing the same logic multiple times, developers can write it once and reuse it throughout the application.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: DRY code promotes consistency in the codebase, as there's a single source of truth for specific logic or data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Following are some concepts in software engineering that are based on the DRY principle -&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Inheritance and Composition&lt;/strong&gt;: Both inheritance and composition allow you to write code in one place and then reuse it at other places.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Database Normalization&lt;/strong&gt;: Database normalization is a design technique used in databases to eliminate redundancy (repetition) of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Disadvantages:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Over-Abstraction&lt;/strong&gt;: Overzealous adherence to DRY can lead to excessive abstractions or premature optimization, which can make the code more complex and harder to understand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trade-offs&lt;/strong&gt;: There can be trade-offs between DRY and other principles, such as readability and performance. Sometimes, duplicating a small piece of code may improve readability or performance without significantly affecting maintainability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;The DRY principle encourages developers to eliminate code redundancy by writing each piece of knowledge or functionality once and reusing it when needed. This promotes code maintainability, readability, and efficiency. However, it should be applied judiciously, as over-optimization or excessive abstraction can lead to complexity and trade-offs.&lt;/p&gt;

</description>
      <category>dry</category>
      <category>designpatterns</category>
      <category>architecture</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>🪨 SOLID Principles</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 10:05:10 +0000</pubDate>
      <link>https://dev.to/amburi/solid-principles-3jpo</link>
      <guid>https://dev.to/amburi/solid-principles-3jpo</guid>
      <description>&lt;p&gt;&lt;strong&gt;SOLID Principles&lt;/strong&gt; are a set of five design principles in object-oriented programming and software engineering that aim to create robust, maintainable, and scalable software. They provide guidelines for writing clean, flexible, and modular code.&lt;/p&gt;

&lt;p&gt;It is a meta acronym where each letter corresponds to another acronym:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SRP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-single-responsibility-principle-srp-4bfm"&gt;Single Responsibility Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OCP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principal-open-closed-principle-ocp-doe"&gt;Open-Closed Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LSP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-liskov-substitution-principle-lsp-1pco"&gt;Liskov Substitution Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ISP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-interface-segregation-principle-isp-bbf"&gt;Interface Segregation Principle&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DIP&lt;/strong&gt;: &lt;a href="https://dev.to/amburi/solid-principles-dependency-inversion-principle-dip-1cpk"&gt;Dependency Inversion Principle&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;





&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principles-single-responsibility-principle-srp-4bfm" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SOLID Principles: Single Responsibility Principle (SRP)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#singleresponsibility&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: A class should have only one reason to change, meaning it should have a single responsibility or job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Encourage modular and focused classes, making code easier to understand and maintain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Improved maintainability, readability, and reusability; easier testing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: Over-applying SRP might lead to excessive class proliferation and complexity.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principal-open-closed-principle-ocp-doe" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SOLID Principles: Open-Closed Principle (OCP)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 10 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#openclosedprinciple&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#ocp&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: Software entities should be open for extension but closed for modification.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Enable adding new features without changing existing code, fostering extensibility.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Reduced risk of introducing bugs, better code organization.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: Overly adhering to OCP can lead to complex designs.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principles-liskov-substitution-principle-lsp-1pco" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SOLID Principles: Liskov Substitution Principle (LSP)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#lsp&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#liskovsubstitution&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#coding&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: Objects of derived classes should be substitutable for objects of their base classes without affecting program correctness.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Ensure behavioral consistency when using derived classes, supporting polymorphism.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Polymorphic behavior, easier maintenance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: Requires careful adherence, can be challenging to implement correctly.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principles-interface-segregation-principle-isp-bbf" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SOLID Principles: Interface Segregation Principle (ISP)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#interfacesegregation&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: Clients should not be forced to depend on interfaces they do not use. Keep interfaces small and specific.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Prevent classes from implementing unnecessary methods, reducing coupling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Better code organization, improved reusability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: Can lead to more interfaces, requiring careful design.&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/amburi" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HRftxO4m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://media.dev.to/cdn-cgi/image/width%3D150%2Cheight%3D150%2Cfit%3Dcover%2Cgravity%3Dauto%2Cformat%3Dauto/https%253A%252F%252Fdev-to-uploads.s3.amazonaws.com%252Fuploads%252Fuser%252Fprofile_image%252F1129325%252F4bf4e9ea-cc64-44a3-b45d-bf34d97cc664.png" alt="amburi"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/amburi/solid-principles-dependency-inversion-principle-dip-1cpk" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;SOLID Principles: Dependency Inversion Principle (DIP)&lt;/h2&gt;
      &lt;h3&gt;Amburi Roy ・ Sep 11 '23&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#solidprinciples&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#designpatterns&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#architecture&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#dependencyinversion&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Definition&lt;/strong&gt;: High-level modules should not depend on low-level modules; both should depend on abstractions. Abstractions should not depend on details; details should depend on abstractions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Goal&lt;/strong&gt;: Reduce coupling, promote modular design, and allow for flexible system changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advantages&lt;/strong&gt;: Reduced coupling, easier testing, improved maintainability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disadvantages&lt;/strong&gt;: May introduce complexity when designing abstractions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Wrap-Up!
&lt;/h2&gt;

&lt;p&gt;SOLID principles offer guidelines to create well-structured and maintainable software. While they provide numerous advantages like better code organization, reusability, and extensibility, they may introduce complexity if applied excessively. Careful application of these principles can lead to more robust and adaptable software systems.&lt;/p&gt;

</description>
      <category>solidprinciples</category>
      <category>architecture</category>
      <category>softwareengineering</category>
      <category>designpatterns</category>
    </item>
    <item>
      <title>SOLID Principles: Dependency Inversion Principle (DIP)</title>
      <dc:creator>Amburi Roy</dc:creator>
      <pubDate>Mon, 11 Sep 2023 09:34:38 +0000</pubDate>
      <link>https://dev.to/amburi/solid-principles-dependency-inversion-principle-dip-1cpk</link>
      <guid>https://dev.to/amburi/solid-principles-dependency-inversion-principle-dip-1cpk</guid>
      <description>&lt;h2&gt;
  
  
  🪨 SOLID Principles
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/amburi/solid-principles-3jpo"&gt;&lt;strong&gt;SOLID&lt;/strong&gt;&lt;/a&gt; is a list of 5 software engineering principles. It is a meta acronym where each letter corresponds to another acronym:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/amburi/solid-principles-single-responsibility-principle-srp-4bfm"&gt;SRP: Single Responsibility Principle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/amburi/solid-principal-open-closed-principle-ocp-doe"&gt;OCP: Open-Closed Principle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/amburi/solid-principles-liskov-substitution-principle-lsp-1pco"&gt;LSP: Liskov Substitution Principle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/amburi/solid-principles-interface-segregation-principle-isp-bbf"&gt;ISP: Interface Segregation Principle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DIP: Dependency Inversion Principle&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without any further ado, let's jump into today's topic:&lt;/p&gt;

&lt;h2&gt;
  
  
  Dependency Inversion Principle (DIP)
&lt;/h2&gt;

&lt;p&gt;Dependency Inversion Principle (DIP) is one of the SOLID principles of object-oriented programming. &lt;/p&gt;

&lt;p&gt;It suggests two main principles: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High-level modules should not depend on low-level modules, but both should depend on abstractions (the Inversion of Control)&lt;/li&gt;
&lt;li&gt;Abstractions should not depend on details, but details should depend on abstractions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Goal:&lt;/strong&gt; The primary goal of the Dependency Inversion Principle is to reduce the coupling between software modules by promoting a flexible and maintainable architecture. It encourages the use of abstractions and interfaces to decouple high-level modules from low-level implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advantages:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reduced Coupling&lt;/strong&gt;: DIP leads to reduced coupling between different modules or classes in a software system. This makes the codebase more flexible and less prone to ripple effects when changes are made.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Improved Testability&lt;/strong&gt;: Code that adheres to DIP is easier to test. High-level modules can be tested in isolation using mock objects or test doubles, allowing for more effective unit testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Increased Reusability&lt;/strong&gt;: Abstractions and interfaces foster code reusability. High-level modules can work with different low-level implementations as long as they adhere to the same abstractions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ease of Maintenance&lt;/strong&gt;: DIP makes it easier to maintain the software system because changes to one module are less likely to affect other modules. It promotes a modular and loosely coupled design.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Bad Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PaymentProcessor&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$gateway&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$gateway&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'Google'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// Code to process payment with Google gateway&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;elseif&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$gateway&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'Apple'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;// Code to process payment with Apple gateway&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nv"&gt;$paymentProcessor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PaymentProcessor&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$paymentProcessor&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Google'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, the &lt;code&gt;PaymentProcessor&lt;/code&gt; class directly depends on the specific payment gateway implementations ('Google' and 'Apple'). This high-level module is tightly coupled to low-level details, violating the Dependency Inversion Principle.&lt;/p&gt;

&lt;h3&gt;
  
  
  Good Example:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="kd"&gt;interface&lt;/span&gt; &lt;span class="nc"&gt;PaymentGateway&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;GooglePaymentGateway&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;PaymentGateway&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Code to process payment with Google gateway&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;ApplePaymentGateway&lt;/span&gt; &lt;span class="kd"&gt;implements&lt;/span&gt; &lt;span class="nc"&gt;PaymentGateway&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;// Code to process payment with Apple gateway&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;PaymentProcessor&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;private&lt;/span&gt; &lt;span class="nv"&gt;$gateway&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;__construct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;PaymentGateway&lt;/span&gt; &lt;span class="nv"&gt;$gateway&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gateway&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$gateway&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="n"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;gateway&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$amount&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nv"&gt;$googleGateway&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;GooglePaymentGateway&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nv"&gt;$paymentProcessor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PaymentProcessor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$googleGateway&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$paymentProcessor&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;processPayment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have adhered to the Dependency Inversion Principle by introducing the &lt;code&gt;PaymentGateway&lt;/code&gt; interface. The &lt;code&gt;PaymentProcessor&lt;/code&gt; class depends on the abstract &lt;code&gt;PaymentGateway&lt;/code&gt; interface rather than concrete implementations. This decoupling allows for flexibility and ease of maintenance. Different payment gateways can be added without modifying existing code, making the system more extensible and adhering to DIP principles.&lt;/p&gt;

</description>
      <category>solidprinciples</category>
      <category>designpatterns</category>
      <category>architecture</category>
      <category>dependencyinversion</category>
    </item>
  </channel>
</rss>
