develooper Front page | perl.perl5.porters | Postings from April 2011

Re: Revising Perl's OO docs - a new OO tutorial

Thread Previous | Thread Next
April 20, 2011 01:31
Re: Revising Perl's OO docs - a new OO tutorial
Message ID:
I liked the tutorial and the coverage of the OOP concepts applied to
Perl, altough I have a question.
when you say :
"Polymorphism is a fancy way of saying that objects from two different
classes share an API. For example, we could have Person and Animal
classes which both have a speak() method. This method might produce
different output for each class, but the basic API is the same.
While the two classes may differ in many ways, when it comes to the
speak() method, they are the same. This means that we can try to call
the speak() method on an object of either class, and we don't have to
know what class the object belongs to!"
it looks to me that this part resembles Interface inheritance, as in
Java/C#, since the Person and Animal classes look unrelated and don't
have a common parent.should it have been moved to the Roles section?
Also the "Overriding methods and method resolution" is an example of
Polymorphism but the term is not mentioned there


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About