You've missed a client isolation implemanaton which would isolate from growing list of your Branch classes. You should have something like Branches class which would compound of all branches, Basically O/C Principle.
@rsKayiiraАй бұрын
Excellent explanation thank you so much
@campbelltechАй бұрын
You are welcome!
@NirmalRaj4dАй бұрын
Wonderful lesson❤ Simple, and yet covered all important aspects.
@campbelltechАй бұрын
Thank you Nirmal!
@abdullahbinmamun3803Ай бұрын
your explanation is very helpful , but I think there is still chances of being the OCP violation. because, in the future we can add ApplePay, VisaCardPay, MastercardPay etc type of payment methods. then we will have to rewrite our enum (basically we will have to add new options in the PaymentMethod enum) and we will have to add more options in the "switch case" PaymentFactory.create method. in this case we can use the help of reflection. so, we won't have to add any more new options to any enum or swith case. Please correct me if I am wrong. I will be delighted to know my mistakes. Thanks a lot for you video. I hope and pray for your wellbeing.
@byronbaronvАй бұрын
This only video resumed more than 6 hours in-person classes and three times more hours of study. At almost 50 my head is not that fast to understand these concepts, so thank you very much for this priceless piece!
@campbelltechАй бұрын
You are welcome, Byron. Thank you for the amazing feedback. We love to simplify complexity.
@souvikdatta97Ай бұрын
Amazing
@campbelltechАй бұрын
Thanks!
@danielvisan34052 ай бұрын
thank you!
@campbelltech16 күн бұрын
You're welcome
@m31coding2 ай бұрын
Great video! The music and your commentary are very relaxing. You might be interested in my library, M31.FluentAPI, for generating builders via Roslyn source code generation. Keep up the great work!
@letsbye2 ай бұрын
I've read that a global variable in python, natively behaves like a singleton, for instance like all the modules once imported, they don't make a difference when trying to re-import. Could you also touch base on that approach and hopefully explain us viewers pls. thanks in advance.
@letsbye2 ай бұрын
Good one, also can you extend this to make it a thread safe one ? pls.
@susanfalk21482 ай бұрын
Great video! I was watching one of your other videos explaining abstract factory methods in C#, but halfway through it was marked as private, so I didn't get to see the rest. Will it come back up?
@tangomoocow2 ай бұрын
A good straight forward example that gets the principle across, thanks for posting.
@campbelltech2 ай бұрын
Thanks Colin, you are welcome
@Nobody-hs9cl2 ай бұрын
A perfect example of the meaningful application of the Factory Design Pattern. I have seen dozens of videos. This is the only one that clearly shows the benefits of the Factory Pattern.
@campbelltech2 ай бұрын
Thank you!
@RahulKashyap-yv5ox3 ай бұрын
Please add more designs pattern in python and some advanced concepts of python . Your lectures are very good 😊
@campbelltech3 ай бұрын
Thank you Rahul!
@RSWDev3 ай бұрын
Low key one of the best explanations I’ve seen of this without BS and annoying editing.
@campbelltech3 ай бұрын
Thank you for the awesome feedback.
@YARBROUGHBRUCE3 ай бұрын
Best tutorial I have seen on this subject. The example classes were much easier to follow and therefor understand without 'abstract' examples such as foo / bar - thank you!
@campbelltech3 ай бұрын
Thank you for the awesome feedback. I strive to simplify complexity.
@of_youtube3 ай бұрын
Why not this.Teacher.MemberwiseClone() as Teacher in 17:52? I liked the video
@botyironcastle3 ай бұрын
what if you have huge data like 100000000comments in Post object. I don't think you can init a domain object with that much... looks useless to me when dealing with large chunks of data. Thoughts?
@manuelgilsitio3 ай бұрын
Thanks, great tutorial!!!
@campbelltech3 ай бұрын
Glad you enjoyed it!
@anurag34873 ай бұрын
I think we need to return the individual factories from the provider methods, and not the interfaces.
@thesandboxgamingvideosАй бұрын
Like this right ? IInternationalFactory internationalFactory = InternationalProvider.CreateCountry(Country.England); ILanguage language = internationalFactory.CreateLanguage(); ICapitalCity capitalCity = internationalFactory.CreateCapitalCity();
@TheIsraelMendoza3 ай бұрын
Not that it matters too much, since Python is a dynamically typed language. I'm not even sure if a tool like mypy would even catch this. But in 4:15 you want to specify the actual "type" of the method's return type, and not an instance of the expected type: @abstractmethod def list_top_attraction(self) -> list[str]: ...
@adilkhatri74754 ай бұрын
can you add all the design pattern for python.
@chrollokillua39454 ай бұрын
Hello sir, would like to ask a question regarding the code in the GitHub repository. In the product class (email_message.py) I see that youve placed a setter method for 'to', which is def set_to. But in the video and the repository, the builder class makes use of the get_to method to get the argument passed to provide the value for 'to'. I may have overlooked it on my part, but I dont see the set_to method being used and I'm kind of confused regarding its purpose. I'd just kindly like to know where the set_to method is being used. Thank you very much!
@definitions4 ай бұрын
would be great if the example shows use case for multiple interfaces in a builder pattern..
@preslaviliev68434 ай бұрын
So easy to grasp .
@campbelltech4 ай бұрын
Thank you Preslav!
@preslaviliev68434 ай бұрын
Really helpful !
@campbelltech4 ай бұрын
Glad it was helpful!
@preslaviliev68434 ай бұрын
So simple . Thanks a lot !
@campbelltech4 ай бұрын
Thanks Preslav!
@user-rm5qq1gd4q4 ай бұрын
Hello Coach, Hope this message finds you well. I'm reaching out to you today because I believe your courses have the potential to attract a significant number of students and generate positive reviews. Would you be interested in proceeding further? Here are my marketing plan to promote your Udemy course to attract more students and gain many positive 5 stars reviews: 1. Offering free Coupon: Provide a taste of your course content with a free coupon to enroll 1000 students in 5 days. 2. Utilizing Social Media 3. Email Marketing Campaign 4. And possibly running ads. I am looking forward to hearing from you soon.
@campbelltech4 ай бұрын
Thank you
@user-rm5qq1gd4q4 ай бұрын
@@campbelltech Hello coach, There are several benefits in promoting your courses and getting positive reviews . Firstly, having thousands of students enrolled in your courses can significantly increase your visibility on the platform, making it easier for new students to discover and enroll in your courses. Additionally, positive 5-star reviews can help establish your credibility as an instructor and encourage more students to enroll in your courses. On the other hand, not having thousands of students and many positive reviews can have some disadvantages. For example, your courses may not be as visible to potential students, making it harder to attract new enrollments. Additionally, having fewer reviews, especially if they are not positive, can make it harder to establish credibility and trust with potential students. Overall, while there are some challenges and disadvantages to consider, the benefits of reaching thousands of students and generating many positive reviews can greatly outweigh them. I look forward to your response, and please let me know if you have any questions on how you can get started.
@javarj66504 ай бұрын
Thanks
@campbelltech4 ай бұрын
You're welcome
@mgaschenbeck4 ай бұрын
Thanks for this video, it's very helpful! One question, however. Using the example at 19:00, what is the correct way to accept a parameter on line 7? We may need to accept "South" or "North" as parameters of SpainFactory constructor to make sure language changes from "Spanish" or "Catalan" respectively. Is there a better pattern for this or do we simply make custom constructors in SpainFactory?
@edoardogribaldo10584 ай бұрын
greatly helpful video thanks!
@campbelltech4 ай бұрын
Glad it was helpful!
@youmnahamdan44384 ай бұрын
Clearly, perfectly explained
@campbelltech4 ай бұрын
Thank you!
@Benndot974 ай бұрын
What extension is he using to get that dropdown menu for creating new C# documents quickly?
@sewcyde4 ай бұрын
DOTNET DEV KIT EXTENSION
@campbelltech4 ай бұрын
And C# Extensions by JosKreativ
@InderjeetSingh-lb5rk5 ай бұрын
UNDERSTOOD EVERYTHING. THANKS MAN!!
@campbelltech5 ай бұрын
Thanks. You're welcome!
@T0g3ly5 ай бұрын
Hi I’m learning design patterns I like your videos but can you possibly make a video of when I should maybe use factory method vs abstract. I understand there isn’t a simple answer but maybe a “Look for these signs answer”
@campbelltech4 ай бұрын
Thanks for the request. I will consider it.
@Guillen86065 ай бұрын
Great video. What font are you using on vsCode?
@campbelltech4 ай бұрын
I use the Material Theme on Linux Ubuntu 22.04.
@biotexcom54645 ай бұрын
your video so top. respect from Ukraine. keep making videos.
@campbelltech5 ай бұрын
Thank you very much!
@lukasberteska87945 ай бұрын
SUPER!!! Clear and easy-to-understand example. Thank you Sir !!!!
@campbelltech5 ай бұрын
Thank you Lukas!
@mohamednassermohamed44315 ай бұрын
first: thanks for explanation, second: what is the diagram tool?
@campbelltech5 ай бұрын
Thanks, I used draw.io for the diagrams.
@ayanesuarezromero42225 ай бұрын
Very educational example. Thank you!
@campbelltech5 ай бұрын
Thanks! You're welcome
@gefirson6 ай бұрын
When you refactored to use ENUMS, you forgot the factory pattern. You've should have instantiated EnglandFactory/SpainFactory on your provider.
@campbelltech5 ай бұрын
You are right. I realized this and fixed in our Udemy course that is based on this video. Will have to update it here also.
@szymaniuk19836 ай бұрын
sheeeet man. That was a great vid. ❤❤❤
@campbelltech6 ай бұрын
Thank you 🙂
@user-of3sh4cg7q6 ай бұрын
Hi can you please tell which keyboard you use the model please
@manikandan0276 ай бұрын
Excellent Explantion with example
@campbelltech6 ай бұрын
Thank you for the awesome feedback.
@NewQuietBear7 ай бұрын
You violate the open/closed principle. Everytime u have to add a new payment method to the factory and enum.
@campbelltech7 ай бұрын
The client code, however, remains unchanged and follows the open-closed principle. Many would argue that adding the enums and extending the factory method only, still remain within the boundaries of the open-closed principle. If you want to comply on all levels, you will have to use reflection, possibly compromising on performance.
@kylebrault44147 ай бұрын
What do you do if CreditCard has a method GetStatement that returns a CreditCardStatementModel object, but GetStatement for paypal returns a PayPalStatementModel object with different fields? Since methods have the same name but a different return type, you couldn't implement a common interface.
@abdullahbinmamun3803Ай бұрын
In this case we can use abstract class instead of using an interface. which can have an abstract method named "Statement" which will return a statement. other classes like GooglePay, PayPal and CreditCard will override and implement the same "Statement" method but will return different statements. I hope, I explained it correctly.