PHP OOP Design Patterns | Factory Method

preview_player
Показать описание
ℹ Factory method is a simple design pattern which enables you to delegate the creation of objects to a dedicated class...keeping your client code lean and observing the single responsibility principle.

💻Source code here:

👇Follow me on Social Media:

💕Show support:
Рекомендации по теме
Комментарии
Автор

Nice one Gary, keep them coming these intermediate videos. Thanks a lot for sharing.

adelhishem
Автор

Great video! Would love to see series on design patterns :)

DanielK
Автор

Well explained, I like that you used real life example. What are the advantages of using Factory Method rather then simple if-else in the controller?

ApplicableProgramming
Автор

NIce Explanation, if i am not wrong decorator design pattern makes more sense for this example, modify the behaviour of free plan objects depending upon the plans. if no then please explain why factory pattern is more suitable.

rahulchavan.
Автор

Thank you for the great videos.
Question: When is it best to favour inheritance over composition?
Is it best to extend abstract classes or code to an interface? Are they any differences?

stylesg
Автор

Does the web server automatically make separate php files visible to others that are in the same namespace (so no need to use ‘include’ or ‘require’ keywords)? That is the only part of this tutorial that’s unclear for viewers working with an IDE and not launching a web server for testing.

dustinandband
Автор

One more comment, while your tutorial is great and informational, you might also want to highlight sanitizing anything that gets passed to the POST and GET superglobals in a basic way. Just a suggestion.

FrankLandry
Автор

When do you use double slashes like these: \\

theman
visit shbcf.ru