PHP Object Oriented Programming #5: Interfaces

preview_player
Показать описание

In tutorial 5 on Object Oriented PHP Programming, we look at interfaces. More specifically, we create a user interface with a public method greeting. We then create english and french users which are required to implement the greeting method. Using a utility class, we then dynamically call the greeting method.

In doing so, we also take a quick look at the popular Factory design pattern near the end of the tutorial.
Рекомендации по теме
Комментарии
Автор

Nice to see how you work through solving how to write the correct code.
That I think is a great lesson in itself, and one I don't consider tedious at all when watching your videos.
Thanks again.

philbx
Автор

I went on some PHP training about two weeks ago and I had a question about interface. I was not satisfied with the answer given. It seemed lacking so I went looking for it here on youtube and watched a couple more videos with the same empty explanation and went on until I found your video. This is exactly the kind of explanation that I was looking for. Thanks!

auggiedomingo
Автор

in this way we could create a multible language website. that's nice.
While defining every function in the interface it automaticly requires some functions.

For example:

$utility->title('english')

And in the english class it called something like: Webshop with brandname

Instead of just entering every single word in php. You should create an YML or XML or JSON file. So you can change the values through a user interface


* I prefer JSON. personal preference.

ChargedLight
Автор

Thank you for the video, great and simple explanation. Could you please however clarify how the "User" parameter option is called in the Utility function? I though it was "instance of" but it's apparently not???

flv
Автор

As cool as this this, I fail to see its usefulness. But I'm also not a developer so I guess there's also that.

ragtop