Been using php for years. Never understood the whole interface business. Now in 20 minutes understand it and now working on a way how to implement it in my current project (where it will solve quite a few problems).
Thanks man. I was failing in understanding why the hell everybody says Interfaces are so powerful and give flexibility to your code. Yeah, they spit those words but they never tell you why, even worst, they just entangle with a lot of technical jargon speaking about things that implement a dependency of an object and blah blah blah (Which can be specially difficult for me because english is my second language and tutorials in spanish are not always very good). Finally someone explain it in plain words, thanks again. I'm guessing this is not the only thing you can do with Interfaces, but I'll keep reasearching and thanks to you I can understand things better now.
Sometimes after watching any video, the best way to consolidate the learning process is to peruse the comment section and listen to other people thought patterns. It is very enlightening, and I give kudos to the video creator and awesome commenters in the comment section. Very educative content, and I am really impress. Thank you
I've never grasped the need for interfaces. I've always felt that I could simply throw them out and the code would still work. This is the first and best explanation of interfaces I have seen. Finally that light is starting to shine in my head. Thank you very much for this lesson. I will be going over your other tutorials and hopefully implement what I've learned in future projects.
I think the paymentProcess() should also be defined in the PaymentInterface interface else the entire code is gonna generate an error while trying to look for it in the BuyProduct Class
as a beginer i understand ZERO from this tutorial, it seems a little bit like rocket science at least, if not extraterestrial communication with earth! I really really wonder how much time it will take to actually be able to implement this by myself, i guess 10 to 20 years!
@@tiagomota4734 exactly me 2 days ago, take a note and break things down to pieces of information on how the flow of the code. You'll get it eventually.
Okay, I watched the whole PHP Series, I am so glad I found you! Really good job on explaining everything in such a simple way and showcasing some usages for everything :)!
This video was pure perfection, thanks so much for the clear explanation about why we use interfaces. I am trying to learn OOP PHP in order to use Laravel and this series is explaining so much
your examples are one of the few that actually make sense and click for me, ive watched tons of youtube videos and took alot of online courses and no one comes close to how well you explain things and how well your examples are done and explained
I feel like we took a huge jump in complexity between episode 11 and this one, haha. Struggling to keep up, but thank you so much for everything you're doing with this channel!
I agree somewhat. I think it started out great, and a useful feature. But then I know it had too many twists and turns that my eyes glazed over. I may have to watch it again, but stop before it gets too far and just absorb that first. I'm hooked on his videos.
Thank you, I could never understand Interfaces until now. To simplify I would just say it's a good way of implementing inheritance for multiple classes, usually you can only inherit one class at a time.
You did it :) I have been watching multiple videos on RU-vid from many so-called tech gurus for the last 2 hours just to understand why should use interface in my code but finally, I got at least one reason from this video.
I am having so much fun watching this and matching it to a Laravel project I have been working on and stuff is finally starting to click for real. This is after I thought I knew it all !@@! Great Great Video !!!!! - as always by Dani
that effect when type hahahahha... very good content, thank you for this tutorials, please continue to create web tutorial, your tutorial are all awesome and helpful
Well done for your work!! 👏 Honestly, the best explanation I could see/hear so far. Finally, I found someone to explains interfaces the right way: What are the interfaces? Where to use them? and Why we use them?. Thank you, Dani!!!!! Keep up the good work! 💯
This exemple is good cause it is very concrete kind of when it is used... the only more complicated understanding is calling an object into a Class which is mind blowing.... that is what i notice :)
i'm new to learn oop, and now i understand how it works by watching your tutorial. thanks a lot sir. hope theres a tutorial for using this oop for a simple website sir.
i love you man, i love you, i can now say that i know what are interfaces and why are they used for , after watching 10 videos minimum and reading million articles on this subject i didn't know the actual implementation. Plus that useful dependency injection tip is just magic so useful. THANK YOU MAN !!!!
Extremely well done explanation! I really appreciate your style - showing / explaining while the classes are created an evolves into implementing the interfaces Never saw/heard a better explanation. 13 on a 10 scale!
I like your tutorials. I went through many, really many and find yours the best. Keep going :) And Thanks also for the funny part correcting the typo :D
this is the third time I'm watching this xD finally, I understand it!...maybe a bit..I'll try to practice it as well. Thank you so much for your tutorials, I've been following it since last week T-T
Thank you very much for doing this video! Good job, i also understand now what is an interface in php und what is for. You have a very pleasure way to teaching that stuff! Thx And "Schöne Grüße aus Deutschland"
Great job man. But I could not understand one thing: In the Class "BuyProduct", we are trying to use the mutual method "paymentProcess". However, the "PaymentInterface" does not contain the rule of that. It does not throw any error message though. Could you help to explain a little bit on that?
I don't really think you need an answer anymore but (if someone else might have this confusion) it's because we are receiving the object of one of the classes and using that object to access "paymentProcess()". All the classes do contain paymentProcess so it works, even though the interface doesn't specify that rule. The classes can possibly contain other methods along with the specified ones (which are required).
I think it is better to include the login process inside the payNow() method in both Visa and Paypal classes... Interfaces, as the word suggest, only show us the frontier of the function and it doesn't need to understand what and how payNow() would process the request. Adding the login logics into the payNow() method would save you even more unnecessary complexities (more lines of code, another interface [LoginInterface], another method [paymentProcess] in PaymentInterface)
True. I'm very happy with the way he explained it. I haven't really understood interfaces till now. But i don't get why the paymentProcess() wasn't included in the Payment interface but it was implemented in all the classes that extended that interface. care to explain that ?
you muss declare both payNow() and paymentProcess()in the interface , because those methods should be declared in all the classes that implements the interface.
Ha, this was my question as soon as he started writing the second interface. Still processing but to my mind atm, since not all of the classes that implement the paymentProcess interface also have the loginFirst method, you'd still have to abstract up a layer anyway. I guess you could do it at least two different ways.
hello, may I ask two questions please: 1. why you don't create one interface like PaymentInterface and inserted (public function paymentProcess(); ) method inside it? 2. when you create a second interface called (LoginInterface) why you didn't add it to the BuyProduct claas function (pay() ) ??
Wow, I didn't think someone came make so simple concept so confusing. You create an interface in order to implement classes based on that interface, and these classes performs same tasks with slightly different parameters or in different ways. For example: you'll create an interface with for payment, with multiple payment methods, and one method which handles the actual payment. Then in the class where you implement it, you'll just refer the method which handles the payment with required parameters. This helps organising your code base and implement new payment methods via the interface.
Hi again, there is an inconsistence in the code that I think everybody should be watch. In the class BuyProduct, we are defining an interface to get recieved, then, we are accessing to a method that not exists, in this case I'm talking about paymentProcess() which is not defined in the PaymentInterface, when we are passing a "Cash" object at the BuyProduct's instance.
Assalam Alaykum< God bless you Brother MMTUTS really understanding your method of teaching us But please, Kindly help separate PHP OOP ffrom that of ther course. I mean separate them and use Numbers for users to be able to download easily. thank you SIR
Please make video on iterators and generators in php and real life use cases, closures in php, also A real life OOP Project like: POS system would be a great help to learn.
Hi, thanks for this series. I know it been a while but I really hope I get an answer. Question is. How do I get user value from the html form to run the instanciation of their response?