i would like to ask if PHP support object declaration inside an interface???
i could hardly find resources that discusses how to create interfaces, and this was my first step and thanks again… but if anyone might care to give me a site where i can find tutorials about interfaces or OO in PHP as a whole…
a whole lot of thanks.
God bless!
]]>Fair enough.
I appreciate your input as it helps to provide more insight into the subject.
Thanks,
Stefan
]]>But I didn’t agree 100% with the way you described Interfaces. You described interfaces as being an alternative to abstract classs, kind of a more ‘abstract’ abstract class since you do not but in any guts at all. But I do not believe that is the point of an interface and you are really describing a very abstract base class. This was must illustrated by the animal example you gave. You define a class with methods that represent what an animal is and you leave the filling in of methods to classes that inherit form it like this.
Abstract Animal{
-abstract breath()
-abstract eat()
-abstract move()
}
Abstract Aquatic_Animal extends Animal{
-breath{ use_gills();}
-move{ move_fins();}
}
shark extends Aquatic_Animal {
-eat(){ bite(Animal $food);}
}
gold_fish extends Aquatic_Animal{
-eat(){swallow(Plant $food);}
}
Interfaces are more for giving general abilities to classes that aren’t logical parts of the class itself. Things of this nature would be ‘Draw’ class that would have a method called ‘draw()’ that returns a image of your animal. Or maybe an iterator interface that lets you treat your object like it is a set.
]]>I’ve updated it with the full podcast – it is now about 11 minutes.
Sorry about the confusion.
Stefan
]]>Thanks, Hugo
]]>Yes, I do find the videos interesting (as well as the mp3s). I really want to learn more about PHP and this is really helping out. Keep up the great work!
]]>Yes the videos are now embedded. I will look into format for downloading – do you have a preference?
That said, do you find the video interesting?
Thanks for the feedback.
Stefan
]]>I noticed the link, but a true podcast has a subscription feature (such as with iTunes or another podcast application) where one can download the actual file and then view it on their computer.
That’s what I meant. The videos are still embedded however and can’t be downloaded, correct?
]]>At the beginning of this article you will notice a link to the mp3 file.
Thanks for the comments.
Stefan
]]>I’m a take it and go kind of guy. 🙂
]]>