PHP Design Patterns course preview - PHP Dependency injection and factory pattern -Advanced OOP PHP

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 79

  • @eatplaythink
    @eatplaythink 3 ปีที่แล้ว +13

    Please continue your good work on PHP course.. its very late from our end.. but we want to learn good things from someone like you.. your approach and teaching methodology is simply superb!

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      Thank you Shasi, I am glad you like videos. The course is almost complete to where I want it to be for now, but I am adding things to it as I make them

  • @engreubenkitilya
    @engreubenkitilya 3 ปีที่แล้ว +3

    I found this channel late, but t help me a lot, thank you so much Dalibor Jovic!

  • @akshaysb526
    @akshaysb526 2 หลายเดือนก่อน

    what a nice explanation. Thank you.

    • @ApplicableProgramming
      @ApplicableProgramming  2 หลายเดือนก่อน +1

      Glad i could help! Consider sharing with someone who might benefit from the video

  • @KennethBoneth
    @KennethBoneth 2 ปีที่แล้ว +2

    Great. I will purchase course I hope you continue making lessons. Only place to find non-junior level knowledge.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Thank you Kenneth, I welcome you to the course. I am sloooowly working on new content, now I am in the process of moving so there is a bit of logistics involved, and I am also in full time studying. So it is a balancing act, but I do work on it whenever I get a chance. Few videos for TH-cam are almost ready and one new module for the course is half done, so new videos are coming soon*

  • @edmondsomosierra
    @edmondsomosierra 2 ปีที่แล้ว +1

    After I finished your oop cms I will buy your course design patterns soon. Your way of teaching theory and practical example is the best. I already subscribed your channel.😊😉

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Thank you Edmond, that is very nice to hear. See you in the course! :)

  • @PureAngel993
    @PureAngel993 3 ปีที่แล้ว +2

    I realy like your videos! Continue filming more, please!

  • @sabuein
    @sabuein ปีที่แล้ว +1

    Thank you so much.

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว

      My pleasure, glad you liked the video :)
      May I ask what interested you into Design Patterns?

  • @danielxie4636
    @danielxie4636 3 ปีที่แล้ว +1

    Erolled with no hesitation, I rushed to get my card, put in my number, the whole process took me less than 2 minutes!

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      Welcome and thank you for your trust! :) I really hope that you will enjoy the course and get all is benefits. Please do not hesitate to ask me whatever comes to your mind or any feedback you might have. What do you hope design patterns will help you with?

  • @DeLvoy1988
    @DeLvoy1988 2 ปีที่แล้ว

    That presentation in the beginning expectations/reality was hilarious :D !

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Thanks, glad you liked it! :)
      I never saw your comment before, not sure why...

  • @PureAngel993
    @PureAngel993 3 ปีที่แล้ว +1

    Also, I will try your course. I belive it is very useful, considering that these clips are great

  • @mahmoudasmaail3549
    @mahmoudasmaail3549 2 ปีที่แล้ว +1

    Thank you

  • @rieltork2360
    @rieltork2360 2 ปีที่แล้ว +1

    Really really awesome video 👍 thank you a lot

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Thank you very much Rieltork. Are you already working with PHP or still learning?

    • @rieltork2360
      @rieltork2360 2 ปีที่แล้ว +1

      @@ApplicableProgramming Both ^^ I'm a freelancer who wants to improve further. I've bought your course :) . I've worked with Laravel over the last years and had a some moments where I realized that I was applying some things but not understanding them 100%. :)

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      @@rieltork2360 you will not believe it but when I saw your comment, I checked the list of students in last few weeks and could not connect you to anyone by username :)
      So I had a hunch, but failed to deliver to the feeling.
      Did the course help in any way, if I may ask so publicly? :D

    • @rieltork2360
      @rieltork2360 2 ปีที่แล้ว +1

      ​@@ApplicableProgramming I bought the course 2 days ago and will not get to it until the weekend :) But I will share the feedback here with pleasure

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@rieltork2360 Welcome to the course (I've sent you an email, in case it went to spam)

  • @ScorpioT1000
    @ScorpioT1000 3 ปีที่แล้ว +1

    your User is actually a UserRepository/UserStorage, it cannot be named like that, same for "Email", it can be e.g. EmailSender

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      That is a very good point actually, services should be verbs. I wanted to gradually build up the course from first lesson so that it grows slowly I guess, so yeah.. a lot of things to think about at the same time :)
      Do you use Design Patterns in your projects?

  • @silberJon
    @silberJon 2 ปีที่แล้ว +1

    Why use depencency injection and not inheritance? Have a parent Mailer class that defines the generic methods, and then a couple of child classes that implement some interface, each according to their own specific need...

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      That is a good question. Why not both?
      Basically the dependency injection "solves" the problem of having classes depend on each other, like Mailer and Database in this example. There is nothing preventing us to inherit the Mailer and have its children do more specific functions like GmailMailer, MailgunMailer, SmtpMailer etc.
      Inheritance would in this case extend the functionality of the class, while dependency injection would keep it from doing more the "just sending emails" (like creating database objects etc).
      Or was there something else you had in mind?

  • @drlawrencemayo
    @drlawrencemayo 2 ปีที่แล้ว +2

    Hi i am a medical doctor, studying programming (currently Php) my aim is to branch out of medical career to software development and development of healthcare apps. great video on php. however i am confused when to use methods and not.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      That is a great question. I like that you are using your existing credibility and leverage for going into the new field, it is a huge plus knowing two fields.
      If you are asking about methods vs functions, it comes down to preference or to architectural choices. You can achieve a lot with functional programming, however object approach has a lot of benefits, and majority of modern apps and libraries use object approach (methods). I personally go with oop/methods by default as I am very used to it, but it is not something you have to choose exclusively.
      Was that the question you had, or were you confused about the methods in some other context?

    • @btm1
      @btm1 2 ปีที่แล้ว +2

      Good luck to you! It will probably not be an easy journey, as it is hard to be a specialist in more than 1 field!

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      @@btm1 that is a very interesting point, but I do wonder how much one must specialise in something in order to be able to make something with it. I bought a 3d printer, and in no way am i going to be a specialist in 3d, but I do manage to make some relatively complex things using it... One engineer could say the same for me, i wonder..

    • @vukkulvar9769
      @vukkulvar9769 2 ปีที่แล้ว

      I would recommend learning NodeJs/TypeScript as well.
      I've seen more than one job offer for healthcare and HIPAA compliant data exchange services that were based on them.
      They're based on HL7/FHIR standard too if you want to learn something that's not a language specific but will likely be needed.

  • @45Supergun
    @45Supergun 2 ปีที่แล้ว +2

    I've always hated the term, "Dependency Injection": the correct term should be "Implementation Injection" because it focuses the coder's attention on what should be done: leverage the power of Interfaces to inject (different) behaviors. The is what "...coding to an interface" means (i.e.: composition over inheritance

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      I see your point. But you can use dependency injection without interfaces/implementation, and also interfaces/implementation without DI?
      F.eks. vanilla JavaScript, not that much support for interfaces, but you can still use dependency injection pattern.
      In that case, implementation injection is a bit questionable, as who knows what implementation looks like. But we know there are dependencies for sure.
      Still sounds like two different things to me, but i would like to think about your point a bit more

  • @pahtashow
    @pahtashow ปีที่แล้ว +1

    1:29 Great course! You do not explain in animals but you explain in Symfony when Laravel is more popular?

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว

      Thanks. I mentioned Symfony here because OOP is more visible when you write code, but in the actual course no framework is used, just examples of design pattern are mentioned. Anyway, frameworks come and disappear. I remember when jQuery was very popular, but that doesn't make it good though :)

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว

      at 24:51 I do go over one example in Laravel :)

  • @Quynn-Oneal
    @Quynn-Oneal 3 ปีที่แล้ว +2

    the problem with the dependency injection is that if you have a class that dependents on too many external classes, you will have an extremely long constructor. IDK if there is a solution to this?

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      That could be true. Easiest solution (easier said then done) is to not have too many dependencies. If your class is focused on one thing only, rarely will it have that many dependencies inserted in the constructor. You could use a Factory Pattern for constructing and configuring dependencies. But that could be misusing the factory pattern to be honest.
      Again the best is not to have too many dependencies, as that usually means that you are doing way too many things in the class.
      Do you have an example of a class that might have a lot of dependencies in the constructor?

    • @Quynn-Oneal
      @Quynn-Oneal 3 ปีที่แล้ว +1

      @@ApplicableProgramming Currently I can't remember when I have faced this issue so I don't know where it resides in my past projects. But I remember it bothered me a lot.
      Yet another problem with this is the order of the dependencies. Let's imagine if an object doesn't need the other class but rather the second in the constructor but in any case you have inject to first variable to reach the second one which is actually needed by the class. We can pass it as an array argument but it has it's disadavantages too.
      Thanks for your fast reply.

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว +1

      @@Quynn-Oneal Could that particular case be improved with soft dependencies?
      Like configureFunctionalityA($object1, $object2);, and configureFunctionalityB($object2, $object3)?
      And throw exception in case required dependency is missing in the main method you want to perform the action in?
      something like Imagine library (and libraries in general) is doing when you want to say resize, you would send in configuration objects as dependencies only for that particular operation imagine.readthedocs.io/en/stable/usage/introduction.html#resize-images
      Because if you would to put them in the constructor, you would get a huge mess of nulls on different places, as each operation might have a different dependency need. Would that maybe solve the first example you were referring to?

  • @amigaworkbench720
    @amigaworkbench720 3 ปีที่แล้ว +1

    So underneath services are dependency injection containers?
    The point is to construct objects somewhere and store them in container (for
    example) associative array. And then you can get object with associative
    array key?

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      That sounds like a way of making dependency injection container yeah. Associative array is used as a map in php, so that would point to the correct service. You would need a bit of logic around initializing those services, and properly resolving them if they exist in the map or not. To be honest I never made dependency injection container, I just used ones that come with Laravel/Yii2, in smaller projects I would just inject needed service directly from the controller. I do not need it more complicated then that. While I was researching this topic I did find the PHP-DI 6 library php-di.org/ that looks like it does all one might need for injection dependencies into objects, maybe you can check that out if you want to make one or see how they do it behind the scenes. But yeah, I would also start the way you explained it.

  • @elviradjuraskovic8156
    @elviradjuraskovic8156 2 ปีที่แล้ว +1

    Odličan kanal Dalibore! Imaš li materijala i na našem jeziku?

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      Hvala Elvira. Nazalost nemam nista na Srpskom/Balkanskom, iz prostog razloga jer je ista kolicina posla za sadrzaj, a iskljucuje 98% mogucnosti potencijala koji sadrzaj moze da dostigne :)

    • @elviradjuraskovic8156
      @elviradjuraskovic8156 2 ปีที่แล้ว +1

      @@ApplicableProgramming Hvala na odgovoru Dalibore i slazem se s tobom, ipak je engleski sluzbeni jezik u software developmentu. Pitala sam iz kurioziteta, balkansko trziste jos nitko nije pokrio, a vjerujem da bi imao puno uspijeha i kod nas.
      Zelim ti sve najbolje i veliki pozdrav iz Frankfurta!

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@elviradjuraskovic8156 Pozdrav za Frankfurt iz Norverske :)

  • @llBestBoyll
    @llBestBoyll 2 ปีที่แล้ว +1

    nice video man 👌🏼🔥

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Thanks man! May i ask how did you find the video? Did you search for design patterns in PHP?

    • @llBestBoyll
      @llBestBoyll 2 ปีที่แล้ว +1

      @@ApplicableProgramming I just scrolling down yt

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      @@llBestBoyll Nice, finally got TH-cam to recommend videos to people :D
      I assume you work with PHP, or have searched for it recently?

    • @llBestBoyll
      @llBestBoyll 2 ปีที่แล้ว +1

      @@ApplicableProgramming i'm using php for more than 2 years
      and i just love it as my primary langauge 🔥❤️

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +1

      yeah, php is here to stay for some more time at least..

  • @SaiyanJin85
    @SaiyanJin85 ปีที่แล้ว +1

    Magneto is great resource to learn how to organizes your code and how to use design patterns but unfortunately it is over engineered and that’s an important lesson too. Making everything a pattern and adding a level of abstraction to everything make the code base incomprehensible and unreadable even for experienced programmers - aside the fact it makes the system very heavy resource wise

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว +1

      oh yeah that is for sure a thing. However, mostly patterns and abstractions are in use when they solve some problems as they occur, and not just for the fun of it. At least that is how I think about it :) why would you complicate something that works just great?

    • @SaiyanJin85
      @SaiyanJin85 ปีที่แล้ว +1

      @@ApplicableProgramming yeah, not every thing need to become a design pattern, many people overdo it unnecessarily, have you played with Magento? I think you would agree with me, 2gigs of ram in order to run according to the docs.. 2gigs...omg

    • @ApplicableProgramming
      @ApplicableProgramming  11 หลายเดือนก่อน

      @@SaiyanJin85 yeah, memory usage went trough the skyes in recent years for sure

  • @alicenNorwood
    @alicenNorwood 3 ปีที่แล้ว +2

    Maxim Martsinkevich?

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว

      Not familiar with him. Was he famous?

    • @Maximilyan29
      @Maximilyan29 2 ปีที่แล้ว +1

      @@ApplicableProgramming leader of the National Socialism movement in Russia

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +2

      @@Maximilyan29 Oh, I thought he somehow relates to design patterns in php :) does he?

  • @fitter2boss72
    @fitter2boss72 ปีที่แล้ว

    Do you plan to add Filter pattern to your course? If you will try to find something about that pattern Google gives you a couple results only. (Thank you for your video)

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว +1

      Good suggestion. I am planning to add two more patterns in the course, and do a couple of "honorable mentioned". Since filter pattern is not that popular/used, it will probably end up on the latter group. But i cannot guarantee when will that happen. Do you have a specific use for it? I've seen some examples on the internet that so not that difficult to convert in PHP as well

  • @Zullv
    @Zullv 2 ปีที่แล้ว +1

    Very interesting; definitely a subject matter worth learning and spending money on. Shame you chose PHP.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว

      Hehe, I see. What do you use? Maybe i can make the same course in another language

    • @Zullv
      @Zullv 2 ปีที่แล้ว +1

      Personally I know JS, PHP and Python, but use PHP the least (not at all, if I can help it). These days it's mostly used to either maintain legacy software or for Wordpress. Not exactly cutting edge stuff.

    • @ApplicableProgramming
      @ApplicableProgramming  2 ปีที่แล้ว +2

      @@Zullv yeah probably the same here in Norway. Although to be honest, more and more corporates use it for "quick" projects. In my previous company we used it with CraftCMS for our websites, but then we also replaces our gigantic Java CRM system with VtigerCRM which is also written in PHP, just because they are more flexible and faster to work with. So... I guess it depends on where you are and what you do, but I would not give up on it yet to be honest :)
      In the end, it is just a tool/language that can solve the problem at hand, all principles from the video apply to other languages/tools as well :)

  • @truthteachers
    @truthteachers ปีที่แล้ว +1

    Bro, you seem to be talking to yourself and many instance you seem confused yourself.. Conclusion: I came back to where i started - all confused. Your presentation, flow and examples need a lot of improvement. Especially, when you say "previous video or course..". Tried look looking for the "previous" and could not find one. My suggestion is: Please redo the whole playlist. This is just my feedback, not necessarily the same for others.

    • @ApplicableProgramming
      @ApplicableProgramming  ปีที่แล้ว

      Thank you for your feedback, I really appreciate it. I think that the most confusion comes because this 30min video is compilation of a full 8 hours course, that is why I mention "in previous video", because this is just a course preview as I mentioned in the description.
      I do see your point, makes sense that it is confusing when videos are missing in between

  • @xbbshampoo
    @xbbshampoo 3 ปีที่แล้ว +1

    Hi, is there any coupon code for the course?

    • @ApplicableProgramming
      @ApplicableProgramming  3 ปีที่แล้ว +1

      Hi, not at the level it was when the course was at the beginning. That was for early supporters who "believed". It is still discounted though, as now the course has about 4-5 hours and 7 modules, so it is priced accordingly.
      In fact, the price will probably go up in few weeks when I add two more modules (which you get for free if you purchase with todays prices)

  • @KaloyCoder
    @KaloyCoder 2 ปีที่แล้ว

    Can I get valid coupons thanks!

  • @ApplicableProgramming
    @ApplicableProgramming  3 ปีที่แล้ว +1

    Check the video description for a 70% discount (limited number of students!)