Тёмный
campbelltech
campbelltech
campbelltech
Подписаться
campbelltech.io is a technology training company that specializes in teaching complex topics in a way that is practical and easy to understand.
Mastering the Composite Design Pattern in C#
22:00
9 месяцев назад
Mastering the Singleton Design Pattern in Python
11:13
10 месяцев назад
Prototype Pattern in Python: A Step-by-Step Guide
22:42
10 месяцев назад
Prototype Pattern in Java: A Step-by-Step Guide
19:49
11 месяцев назад
Prototype Pattern in C#: A Step-by-Step Guide
20:00
11 месяцев назад
Abstract Factory Pattern Made Simple in C#
25:04
11 месяцев назад
Abstract Factory Pattern Made Simple in Java
21:31
11 месяцев назад
What is an Event Store?
1:01
Год назад
Injectable Factory Method in .NET
20:31
Год назад
What is a DDD Aggregate?
2:17
Год назад
Комментарии
@igormixx
@igormixx 4 дня назад
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
@rsKayiira 8 дней назад
Excellent explanation thank you so much
@campbelltech
@campbelltech 7 дней назад
You are welcome!
@NirmalRaj4d
@NirmalRaj4d 12 дней назад
Wonderful lesson❤ Simple, and yet covered all important aspects.
@campbelltech
@campbelltech 7 дней назад
Thank you Nirmal!
@abdullahbinmamun3803
@abdullahbinmamun3803 19 дней назад
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
@byronbaronv 19 дней назад
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
@campbelltech 19 дней назад
You are welcome, Byron. Thank you for the amazing feedback. We love to simplify complexity.
@souvikdatta97
@souvikdatta97 24 дня назад
Amazing
@campbelltech
@campbelltech 7 дней назад
Thanks!
@danielvisan3405
@danielvisan3405 Месяц назад
thank you!
@m31coding
@m31coding Месяц назад
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!
@letsbye
@letsbye Месяц назад
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.
@letsbye
@letsbye Месяц назад
Good one, also can you extend this to make it a thread safe one ? pls.
@susanfalk2148
@susanfalk2148 Месяц назад
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?
@tangomoocow
@tangomoocow Месяц назад
A good straight forward example that gets the principle across, thanks for posting.
@campbelltech
@campbelltech Месяц назад
Thanks Colin, you are welcome
@Nobody-hs9cl
@Nobody-hs9cl Месяц назад
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.
@campbelltech
@campbelltech Месяц назад
Thank you!
@RahulKashyap-yv5ox
@RahulKashyap-yv5ox 2 месяца назад
Please add more designs pattern in python and some advanced concepts of python . Your lectures are very good 😊
@campbelltech
@campbelltech 2 месяца назад
Thank you Rahul!
@RSWDev
@RSWDev 2 месяца назад
Low key one of the best explanations I’ve seen of this without BS and annoying editing.
@campbelltech
@campbelltech 2 месяца назад
Thank you for the awesome feedback.
@YARBROUGHBRUCE
@YARBROUGHBRUCE 2 месяца назад
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!
@campbelltech
@campbelltech 2 месяца назад
Thank you for the awesome feedback. I strive to simplify complexity.
@of_youtube
@of_youtube 2 месяца назад
Why not this.Teacher.MemberwiseClone() as Teacher in 17:52? I liked the video
@botyironcastle
@botyironcastle 2 месяца назад
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?
@manuelgilsitio
@manuelgilsitio 2 месяца назад
Thanks, great tutorial!!!
@campbelltech
@campbelltech 2 месяца назад
Glad you enjoyed it!
@anurag3487
@anurag3487 2 месяца назад
I think we need to return the individual factories from the provider methods, and not the interfaces.
@thesandboxgamingvideos
@thesandboxgamingvideos 8 дней назад
Like this right ? IInternationalFactory internationalFactory = InternationalProvider.CreateCountry(Country.England); ILanguage language = internationalFactory.CreateLanguage(); ICapitalCity capitalCity = internationalFactory.CreateCapitalCity();
@TheIsraelMendoza
@TheIsraelMendoza 2 месяца назад
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]: ...
@adilkhatri7475
@adilkhatri7475 3 месяца назад
can you add all the design pattern for python.
@chrollokillua3945
@chrollokillua3945 3 месяца назад
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!
@definitions
@definitions 3 месяца назад
would be great if the example shows use case for multiple interfaces in a builder pattern..
@preslaviliev6843
@preslaviliev6843 3 месяца назад
So easy to grasp .
@campbelltech
@campbelltech 3 месяца назад
Thank you Preslav!
@preslaviliev6843
@preslaviliev6843 3 месяца назад
Really helpful !
@campbelltech
@campbelltech 3 месяца назад
Glad it was helpful!
@preslaviliev6843
@preslaviliev6843 3 месяца назад
So simple . Thanks a lot !
@campbelltech
@campbelltech 3 месяца назад
Thanks Preslav!
@user-rm5qq1gd4q
@user-rm5qq1gd4q 3 месяца назад
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.
@campbelltech
@campbelltech 3 месяца назад
Thank you
@user-rm5qq1gd4q
@user-rm5qq1gd4q 3 месяца назад
@@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.
@javarj6650
@javarj6650 3 месяца назад
Thanks
@campbelltech
@campbelltech 3 месяца назад
You're welcome
@mgaschenbeck
@mgaschenbeck 3 месяца назад
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?
@edoardogribaldo1058
@edoardogribaldo1058 3 месяца назад
greatly helpful video thanks!
@campbelltech
@campbelltech 3 месяца назад
Glad it was helpful!
@youmnahamdan4438
@youmnahamdan4438 3 месяца назад
Clearly, perfectly explained
@campbelltech
@campbelltech 3 месяца назад
Thank you!
@Benndot97
@Benndot97 3 месяца назад
What extension is he using to get that dropdown menu for creating new C# documents quickly?
@sewcyde
@sewcyde 3 месяца назад
DOTNET DEV KIT EXTENSION
@campbelltech
@campbelltech 3 месяца назад
And C# Extensions by JosKreativ
@InderjeetSingh-lb5rk
@InderjeetSingh-lb5rk 4 месяца назад
UNDERSTOOD EVERYTHING. THANKS MAN!!
@campbelltech
@campbelltech 4 месяца назад
Thanks. You're welcome!
@T0g3ly
@T0g3ly 4 месяца назад
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”
@campbelltech
@campbelltech 3 месяца назад
Thanks for the request. I will consider it.
@Guillen8606
@Guillen8606 4 месяца назад
Great video. What font are you using on vsCode?
@campbelltech
@campbelltech 3 месяца назад
I use the Material Theme on Linux Ubuntu 22.04.
@biotexcom5464
@biotexcom5464 4 месяца назад
your video so top. respect from Ukraine. keep making videos.
@campbelltech
@campbelltech 4 месяца назад
Thank you very much!
@lukasberteska8794
@lukasberteska8794 4 месяца назад
SUPER!!! Clear and easy-to-understand example. Thank you Sir !!!!
@lukasberteska8794
@lukasberteska8794 4 месяца назад
Can you maybe add diagrams to git, please? Visualization always helps to understand better.
@campbelltech
@campbelltech 4 месяца назад
Thank you Lukas!
@campbelltech
@campbelltech 4 месяца назад
Great idea. Will do.
@mohamednassermohamed4431
@mohamednassermohamed4431 4 месяца назад
first: thanks for explanation, second: what is the diagram tool?
@campbelltech
@campbelltech 4 месяца назад
Thanks, I used draw.io for the diagrams.
@ayanesuarezromero4222
@ayanesuarezromero4222 4 месяца назад
Very educational example. Thank you!
@campbelltech
@campbelltech 4 месяца назад
Thanks! You're welcome
@gefirson
@gefirson 4 месяца назад
When you refactored to use ENUMS, you forgot the factory pattern. You've should have instantiated EnglandFactory/SpainFactory on your provider.
@campbelltech
@campbelltech 4 месяца назад
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.
@szymaniuk1983
@szymaniuk1983 4 месяца назад
sheeeet man. That was a great vid. ❤❤❤
@campbelltech
@campbelltech 4 месяца назад
Thank you 🙂
@user-of3sh4cg7q
@user-of3sh4cg7q 5 месяцев назад
Hi can you please tell which keyboard you use the model please
@campbelltech
@campbelltech 5 месяцев назад
Logitech K220.
@manikandan027
@manikandan027 5 месяцев назад
Excellent Explantion with example
@campbelltech
@campbelltech 5 месяцев назад
Thank you for the awesome feedback.
@NewQuietBear
@NewQuietBear 6 месяцев назад
You violate the open/closed principle. Everytime u have to add a new payment method to the factory and enum.
@campbelltech
@campbelltech 6 месяцев назад
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.
@kylebrault4414
@kylebrault4414 6 месяцев назад
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.
@campbelltech
@campbelltech 6 месяцев назад
Hi Kyle, you can introduce a base or abstract StatementModel. Then CreditCardStatementModel and PayPalStatementModel can inherit from or extend StatementModel. Then, let the GetStatement method return StatementModel, and through Polymorphism you can "cast" it back to the concrete types in the concrete classes.
@abdullahbinmamun3803
@abdullahbinmamun3803 19 дней назад
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.
@Michallote
@Michallote 6 месяцев назад
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 6 месяцев назад
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?
@jccorman5848
@jccorman5848 6 месяцев назад
Excellent thank you. Can you tell me what is the difference between this pattern and a Factory Pattern, and what is the advantage of using this pattern (in what context?). You have a very good logical way of explaining. Please do more videos on Python.
@campbelltech
@campbelltech 6 месяцев назад
Thanks, JC! The main difference between the builder pattern and the factory pattern lies in their focus: Fluent builder pattern: Helps construct complex objects step-by-step with optional configurations. It acts like a "recipe" where you choose the ingredients (object properties) and add them one by one. This enables flexible object creation with improved readability, especially for objects with many optional fields. Factory pattern: Deals with encapsulating object creation logic and choosing the right type of object to create based on certain criteria. It's like a switchboard that decides which "machine" (object) to turn on based on the input. This promotes loose coupling and simplifies object creation when choosing between different implementations. The advantages of using these patterns depend on the context: Use the fluent builder pattern when: - You have a complex object with many optional configurations. - You want to improve code readability and clarity for object creation. - You need a flexible way to define default values for optional fields. Use the factory pattern when: - You need to create different types of objects based on different conditions. - You want to decouple your code from the specific implementation details of object creation. - You want to centralize the logic for choosing the right object type.
@jccorman5848
@jccorman5848 6 месяцев назад
You're a star. thanks. @@campbelltech 🤩
@msdhonicoolcaptain
@msdhonicoolcaptain 6 месяцев назад
Just loved your explanation!! more energy to you
@campbelltech
@campbelltech 6 месяцев назад
Thank you! The same to you!
@robinscooby412
@robinscooby412 6 месяцев назад
you are awesome...❤
@campbelltech
@campbelltech 6 месяцев назад
Thank you Robin, I am glad you enjoyed the video :-)