Factory Method Pattern in Python: Creating Objects with Ease

Поділитися
Вставка
  • Опубліковано 29 вер 2024
  • In this informative video, we delve into the powerful world of design patterns in Python, focusing on the Factory Method Pattern. If you're looking to enhance your programming skills and create objects effortlessly, you're in the right place.
    In this tutorial, you'll learn the core concepts of the Factory Method Pattern and how to implement it in Python.
    🔔 Don't forget to subscribe and hit the bell icon to stay updated with our latest tutorials!
    If you found this video helpful, give it a thumbs up and share it with your fellow developers. Let's master the Factory Pattern together and level up our Python programming game!
    GitHub Code Repository: github.com/sea...

КОМЕНТАРІ • 13

  • @MrAverageViewer
    @MrAverageViewer Рік тому +4

    Very nice tutorial!! I really appreciate that you presented the visual diagram first, before delved into the code. That made it much easier to grasp the overall concept and purpose. Much appreciated!!

    • @campbelltech
      @campbelltech  Рік тому +1

      Thank you for the excellent feedback!

  • @robinscooby412
    @robinscooby412 9 місяців тому +1

    you are awesome...❤

    • @campbelltech
      @campbelltech  9 місяців тому

      Thank you Robin, I am glad you enjoyed the video :-)

  • @Yassou1985
    @Yassou1985 9 місяців тому +2

    Thank you, i have watched 2 of your videos and i really appreciate them. Thanks again for making far more understandable than refactoring guru :D. Just a remark : it would had been nice if you could add a small window on right low corner that highlight the class your are coding of you UML diagram. i was a little lost after the payment package code.

    • @campbelltech
      @campbelltech  9 місяців тому

      Thanks @Yassou1985. This is awesome feedback and motivation for us. Like your idea about showing the class diagram while coding. Thank you.

  • @adilkhatri7475
    @adilkhatri7475 5 місяців тому

    can you add all the design pattern for python.

  • @Michallote
    @Michallote 8 місяців тому

    What happens when I have to pass different parameters to each factory? What if my CreditCard needs additional parametets different from GooglePay or whatever

    • @campbelltech
      @campbelltech  8 місяців тому

      Good question. I would suggest using Polymorphism to overcome this challenge. In other words, have a single parameter that is of a complex object base type. Then you can have multiple concrete classes with the specific fields that you need that extend the base class. Then you can cast the base to the concrete class in your specific implementation (which the factory returns). I hope this makes sense?

  • @szymaniuk1983
    @szymaniuk1983 7 місяців тому +2

    sheeeet man. That was a great vid. ❤❤❤

  • @manuelgilsitio
    @manuelgilsitio 4 місяці тому +1

    Thanks, great tutorial!!!