<?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: Anurag Patil</title>
    <description>The latest articles on DEV Community by Anurag Patil (@anu1996rag).</description>
    <link>https://dev.to/anu1996rag</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%2F1087954%2F8cf2fe37-b7b3-4315-b547-0805e84e4bcd.jpg</url>
      <title>DEV Community: Anurag Patil</title>
      <link>https://dev.to/anu1996rag</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anu1996rag"/>
    <language>en</language>
    <item>
      <title>URL Shortener Microservice using FastAPI and PostgreSQL</title>
      <dc:creator>Anurag Patil</dc:creator>
      <pubDate>Sat, 25 Nov 2023 11:10:29 +0000</pubDate>
      <link>https://dev.to/anu1996rag/url-shortener-microservice-using-fastapi-and-postgresql-45ka</link>
      <guid>https://dev.to/anu1996rag/url-shortener-microservice-using-fastapi-and-postgresql-45ka</guid>
      <description>&lt;p&gt;Hello everyone !&lt;br&gt;
Been a long time that I have made my hands dirty on some projects.&lt;/p&gt;

&lt;p&gt;Currently, am getting to know basics of microservices and how to implement them.&lt;/p&gt;

&lt;p&gt;For a beginner perspective, I have came up with a short microservice which involves all the aspects we need while deploying a microservice.&lt;/p&gt;

&lt;p&gt;It includes the following concepts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Database Integration&lt;/li&gt;
&lt;li&gt;Code Linting&lt;/li&gt;
&lt;li&gt;Design Principles&lt;/li&gt;
&lt;li&gt;Clean Code&lt;/li&gt;
&lt;li&gt;Configuration Management&lt;/li&gt;
&lt;li&gt;Dependency Management&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;API Testing&lt;/li&gt;
&lt;li&gt;Containerization&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I have tried to include as much as I can for a beginner to understand the basics of it in a simple way.&lt;/p&gt;

&lt;p&gt;Please go through the code &lt;a href="https://github.com/Anu1996rag/url_shortener"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Let me know if you find it helpful in the comments.&lt;/p&gt;

&lt;p&gt;Feedbacks and suggestions are always welcomed !!!&lt;br&gt;
Happy Learning !&lt;/p&gt;

</description>
      <category>python</category>
      <category>fastapi</category>
      <category>microservices</category>
      <category>postgres</category>
    </item>
    <item>
      <title>Introduction to Documentation and Code Linting</title>
      <dc:creator>Anurag Patil</dc:creator>
      <pubDate>Tue, 07 Nov 2023 05:40:56 +0000</pubDate>
      <link>https://dev.to/anu1996rag/introduction-to-documentation-and-code-linting-3gap</link>
      <guid>https://dev.to/anu1996rag/introduction-to-documentation-and-code-linting-3gap</guid>
      <description>&lt;p&gt;This blog mainly focuses on two concepts which are a bit underrated. One is code linting and other is live documentation.&lt;/p&gt;

&lt;p&gt;Let's first understand the meaning of these two concepts before we dive into the implementation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Linting
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Linting is the process of running a program that will analyse code for potential errors.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simply put, it is the process of checking the source code for Programmatic as well as Stylistic errors. This is most helpful in identifying some common and uncommon mistakes that are made during coding.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A Lint or a Linter is a program that supports linting (verifying code quality). They are available for most languages like JavaScript, CSS, HTML, Python, etc..&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Running a lint program over your source code, helps to ensure that source code is legible, readable, less polluted and easier to maintain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;It helps you find :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;formatting discrepancies&lt;/li&gt;
&lt;li&gt;find non-adherence to coding standards and                conventions&lt;/li&gt;
&lt;li&gt;pinpoint possible logical errors in your program&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Linting tools usage:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Linting tools can be configured with other tools like git pre commit hook and husky, to ensure that the linting is done of the code that is being committed to a certain repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This will make sure that coding standards are maintained and code is formatted and language specific best practices are adhered before code is committed to the repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Engineers will be able to make the commit only if the said coding standards are met. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ruff - An extremely fast Python linter and code formatter, written in Rust.
&lt;/h4&gt;

&lt;p&gt;Documentation - &lt;a href="https://pypi.org/project/ruff/"&gt;https://pypi.org/project/ruff/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Documentation using &lt;a href="https://www.mkdocs.org/"&gt;MakeDocs&lt;/a&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    “Code is more often read than written.”

    — Guido van Rossum
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Whenever you are using a library, you look for examples or official documentation on how to do something specific.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Software documentation is a crucial part of a working software. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Documentation is crucial because it can assist users understand how to use your software, it can provide developers and other technical stakeholders with information about the technical aspects of your software.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Well-written software documentation can help improve the overall quality and user experience of your software. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Makedocs helps you in creating "auto-generated documentation". It links your information between code and documentation pages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using Makedocs, you can create project documentation with less efforts conveniently and effectively.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Implementation
&lt;/h3&gt;

&lt;p&gt;I have created a sample project which helps you in understanding the basics of code linting and live documentation.&lt;/p&gt;

&lt;p&gt;Source Code : &lt;a href="https://github.com/Anu1996rag/encode_decode.git"&gt;encode_decode&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Documentation : &lt;a href="https://anu1996rag.github.io/encode_decode/"&gt;Encode Decode Docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The documentation is always live and you can access it anytime.&lt;/p&gt;

&lt;p&gt;Please go through the following resources that will help you in understanding the concepts and the implementation better.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://pypi.org/project/ruff/"&gt;https://pypi.org/project/ruff/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://realpython.com/python-project-documentation-with-mkdocs/"&gt;https://realpython.com/python-project-documentation-with-mkdocs/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Happy Learning !!!&lt;/p&gt;

</description>
      <category>python</category>
      <category>ruff</category>
      <category>makedocs</category>
      <category>codelinting</category>
    </item>
    <item>
      <title>Acronyms used in Software Design Practices</title>
      <dc:creator>Anurag Patil</dc:creator>
      <pubDate>Thu, 10 Aug 2023 12:32:07 +0000</pubDate>
      <link>https://dev.to/anu1996rag/acronyms-used-in-software-design-practices-4fdk</link>
      <guid>https://dev.to/anu1996rag/acronyms-used-in-software-design-practices-4fdk</guid>
      <description>&lt;p&gt;While working in the field of software engineering or software development for several years, we come across some acronyms or say technical jargons which we are totally unaware of. &lt;/p&gt;

&lt;p&gt;We often listen to these in the technical discussions with your Architect or in the Code Reviews.&lt;/p&gt;

&lt;p&gt;We also been told to follow clean coding practices or principles, follow some good practices or coding and design standards if given.&lt;/p&gt;

&lt;p&gt;Here, in this blog, I will try to make you aware of some acronyms which are used more often in the industry while working. I have tried to keep it short and concise. People often get bored reading lengthy posts. :P&lt;/p&gt;

&lt;p&gt;I have tried to make this easy-peasy for you so that you can remember them and implement in your day-to-day activities. Also, to help you be the smart guy in the room !! ;)&lt;/p&gt;

&lt;p&gt;One of my favorite lines I came along is : &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Code represents knowledge. By giving meaning to certain parts of the code, we are identifying and labeling that knowledge.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  DRY/OAOO
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DRY&lt;/strong&gt; stands for &lt;strong&gt;Don't Repeat Yourself&lt;/strong&gt; and &lt;strong&gt;OAOO&lt;/strong&gt; stands for &lt;strong&gt;Once and Only Once&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These are self explanatory which says that you should avoid code duplication at all costs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In code, whatever it may be, should be written only once and in a single place. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If there are any modifications to be done in the future, they should be done in that specific location ( here location means class or function or module ). &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Failure to do so is a sign of poor software design.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Code duplication affects maintainability. Some of its cons are:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;It is error-prone.&lt;/li&gt;
&lt;li&gt;It is expensive.&lt;/li&gt;
&lt;li&gt;It is unreliable.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  YAGNI (You Ain't Gonna Need It)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sometimes, while developing a software we think of the future enhancements or requirements and try to make the code future-proof. As a result, we create solutions that are complex or create abstractions which are hard to maintain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After sometime, we get to know that these requirements are not required at all and we end up piling the unnecessary code. And sometimes, due to this the code which we actually need for our current requirements does not work at all. &lt;br&gt;
Feels like a waste of time right ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;YAGNI principle tells us that , do not try to perform futurology or future-proof code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;While designing your system, make sure that you are only addressing your current requirements in such a way that it can be easily modified later on. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not over-engineer !!! &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do not develop or design more than what is necessary.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  KIS/KISS (Keep It Simple / Keep It Simple, Stupid )
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You may have come across this term many times. This principle very much relates to our previous point.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This principle says that implement minimal functionality which correctly solves your problem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In other words, satisfies your current requirement and does not complicate it more than what is necessary.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This principle is what we need to keep in mind at all levels of abstraction. While designing a microservice on a higher-level or defining a function or writing a particular line of code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;At a code level, it simply means using the smallest data structure that fits the problem statement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  EAFP/LBYL
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;EAPF&lt;/strong&gt; stands for &lt;strong&gt;Easier to ask Forgiveness than Permission&lt;/strong&gt; while &lt;strong&gt;LBYL&lt;/strong&gt; stands for &lt;strong&gt;Look Before You Leap&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;EAPF tells us that we write our code so that it performs some execution directly. If the code does not work, we will catch the exception and try to execute some corrective logic on the except block.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We often see this approach used by many developers.&lt;br&gt;
It goes something like this.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;try:
    # your running code
except SomeMeaningfulException as e:
    # corrective actions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;LBYL principle is exactly opposite to that of EAPF.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In this approach, we check what we are about to use or  perform. &lt;br&gt;
For example, before opening a file in the program, we want to check if that file actually exists in the given path or not.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Both of the principles makes sense in a particular code or action. EAFP is more acceptable as it is easier to pick at the first glance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I would suggest to pick up the EAFP when in doubt.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So these are the most common principles you will come across while developing a software and we should take utmost care that these principles are being followed.&lt;/p&gt;

&lt;p&gt;Some of them you make come across while implementing Design Patterns in your system.&lt;/p&gt;

&lt;p&gt;I hope am able to deliver this topic in a simple and in an effective way. Feedbacks and suggestions are always welcomed.&lt;/p&gt;

&lt;p&gt;Happy Learning !!!&lt;/p&gt;

</description>
      <category>softwaredevelopment</category>
      <category>designsystem</category>
      <category>cleancode</category>
      <category>cleanarchitecture</category>
    </item>
    <item>
      <title>Design Patterns in Python : Factory method</title>
      <dc:creator>Anurag Patil</dc:creator>
      <pubDate>Fri, 28 Jul 2023 07:12:55 +0000</pubDate>
      <link>https://dev.to/anu1996rag/design-patterns-in-python-factory-method-2b0h</link>
      <guid>https://dev.to/anu1996rag/design-patterns-in-python-factory-method-2b0h</guid>
      <description>&lt;p&gt;Design Patterns represent an idea, not a particular implementation. By using it, you can make your code more flexible, maintainable, reusable and scalable.&lt;/p&gt;

&lt;p&gt;Design Patterns are reusable programming solutions that have been used in various real-life contexts. There are several categories in Object-Oriented Programming, depending on the type of problem it addresses and the type of solution it helps to build.&lt;/p&gt;

&lt;p&gt;They are split into 3 categories :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Creational&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deals with different aspects of object creation.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Structural&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Proposes a way of composing objects for creating new functionality&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Behavioral&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deals with the communication or interaction of objects&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Am going to discuss one of the creational design patterns here which is the Factory method.&lt;/p&gt;

&lt;p&gt;I have tried to make this as simple as possible so that the novice programmers will also be able to understand what actually are design patterns and why there are used or recommended.&lt;/p&gt;

&lt;p&gt;Lets get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;It is used for providing convenient and better alternatives for object creation.&lt;/p&gt;

&lt;p&gt;In this factory design pattern, the client (means the client code) asks for object creation without knowing where the actual object creation is happening or where is it coming from or which class is used to generate that object.&lt;/p&gt;

&lt;p&gt;This makes it easier to track the objects getting created instead of making the client take care of the direct class instantiation process ( directly creating the object from the class).&lt;/p&gt;

&lt;p&gt;This design pattern helps us in decoupling or separating the logic of object creation from the logic that uses it. &lt;/p&gt;

&lt;h2&gt;
  
  
  When to use it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;If you realise that you cannot track the objects created by the application because there are too many objects created at different places, you should consider using factory method.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Most useful use case is defining a method which returns the database instance creation based on the type of database used.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Whenever there is a change happening, we can change it in a single function and there is no need to change the code which uses that object.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One more important use case is the improvement in the memory allocation and its performance.&lt;br&gt;
At every object creation, memory is allocated. If the object is not used somehow for some time, the allocated memory is just a wasteful allocation. Also, extra memory allocation happens when any new object is created.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Below is a small illustration of the above use case.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class A:
    ...


if __name__ == "__main__":
    a = A()
    b = A()
    print(id(a), id(b))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which gives the below output. It shows 2 different memory allocation happened.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZP3UJznN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pagrectrbryw9s5dltjm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZP3UJznN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pagrectrbryw9s5dltjm.png" alt="Output" width="478" height="179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even if we need the object "a" to execute some actions, "b" will still be created and allocated memory; which is not convenient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementing factory pattern
&lt;/h2&gt;

&lt;p&gt;I have tried to illustrate the factory pattern using a really simple program. You can try to refactor your existing code or write a new one taking reference to this example.&lt;/p&gt;

&lt;p&gt;Okay, so lets create an abstract class first which will keep the program consistent.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from abc import ABC, abstractmethod


class Animal(ABC):
    @abstractmethod
    def make_sound(self):
        pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, lets create two classes which can inherit the Animal properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Dog(Animal):
    def __init__(self):
        self.name = "Mike"

    def __str__(self):
        return self.name

    @property
    def make_sound(self):
        return "bow wow"

class Cat(Animal):
    def __init__(self):
        self.name = "Alexa"

    def __str__(self):
        return self.name

    @property
    def make_sound(self):
        return "meow"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will now create a factory method which returns an instance of either Cat class or a Dog class depending upon the animal type we give as an argument to the function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def animal_invoke_factory(animal: str) -&amp;gt; Animal:
    animal_type = animal.lower().strip()

    if animal_type == "cat":
        result = Cat
    elif animal_type == "dog":
        result = Dog
    else:
        raise ValueError(f"Unable to find {animal}")

    return result()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Am creating a wrapper function around the animal_invoke_factory() function. It also handles the exception raised by the animal_invoke_factory() function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_animal(animal: str) -&amp;gt; Animal:
    factory_obj = None

    try:
        factory_obj = animal_invoke_factory(animal)
    except ValueError as error:
        print(error)

    return factory_obj
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below main() function calls the get_animal() function with the appropriate parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def main():
    animal = get_animal("cat")
    print(f"{animal} says {animal.make_sound}")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Code Repo
&lt;/h3&gt;

&lt;p&gt;Please find the entire code here.&lt;br&gt;
&lt;a href="https://github.com/Anu1996rag/design_patterns/tree/main/factory"&gt;Factory Design Pattern&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's it ! &lt;br&gt;
We are able to implement the factory pattern in a most simple way possible.&lt;/p&gt;

&lt;p&gt;I have tried to make it simple to understand and visualize the concept. &lt;br&gt;
Please let me know your reviews/feedbacks or any suggestions you have.&lt;/p&gt;

&lt;p&gt;Happy Learning !!!&lt;/p&gt;

</description>
      <category>python</category>
      <category>designpatterns</category>
      <category>oop</category>
      <category>lowleveldesign</category>
    </item>
    <item>
      <title>Pub-Sub Architecture using FastAPI and Redis</title>
      <dc:creator>Anurag Patil</dc:creator>
      <pubDate>Mon, 17 Jul 2023 08:07:31 +0000</pubDate>
      <link>https://dev.to/anu1996rag/pub-sub-architecture-using-fastapi-and-redis-3g50</link>
      <guid>https://dev.to/anu1996rag/pub-sub-architecture-using-fastapi-and-redis-3g50</guid>
      <description>&lt;p&gt;I have tried to implement Redis as a message broker using FastAPI. Its a simple implementation to give a headstart for the event driven architecture.&lt;/p&gt;

&lt;p&gt;Below is the high-level view for what I have implemented.&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%2Fh083hiigtwy40bk63k6n.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%2Fh083hiigtwy40bk63k6n.png" alt="pubsub_architecture"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Clone the &lt;a href="https://github.com/Anu1996rag/pubsub" rel="noopener noreferrer"&gt;repo&lt;/a&gt; from here and give it a shot.&lt;/p&gt;

&lt;p&gt;Please feel free to go through it and let me know your suggestions.&lt;br&gt;
Hope to get some positive response as its my first ever post on any community platform so far ..:)&lt;/p&gt;

&lt;p&gt;Happy Learning !!!&lt;/p&gt;

</description>
      <category>redis</category>
      <category>fastapi</category>
      <category>pubsub</category>
      <category>eventdriven</category>
    </item>
  </channel>
</rss>
