Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Thomas Paul:
Polymorphism is overriding, not overloading although you will find plenty of infidels who say otherwise.![]()
Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="http://www.objectfirst.com/blog" target="_blank" rel="nofollow">My Blog</a>
Originally posted by Thomas Paul:
Polymorphism--the same message sent to different objects results in behavior that's dependent on the nature of the object receiving the message.
Same message - different objects -- In other words, overriding not overloading.
As I said, you can find plenty of people that will call overloading a form of polymorphism. They are wrong and should be ignored.
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Rob
SCJP 1.4
My understanding is that "Polymorphism" means "many forms" ans in this reading it can embrace overloading as well, why not (one method for many kinds of parameters).
• Sun Certified Programmer for Java 2 Platform (SCJP2)
• IBM Certified Professional for Object Oriented Analysis and Design with UML
• IBM Certified System Administrator for WebSphere Application Server v5.0
• Certified Business Analysis Professional (CBAP®)
As is implicit in the choice of names,
universal polymorphism is considered true polymorphism, while ad-hoc polymorphism is some kind of
apparent polymorphism whose polymorphic character disappears at close range. Overloading is not true
polymorphism: instead of a value having many types, we allow a symbol to have many types, but the values
denoted by that symbol have distinct and possibly incompatible types.
"..In overloading the same variable name is used to
denote different functions, and the context is used to decide
which function is denoted by a particular instance
of the name. We may imagine that a preprocessing of the program
will eliminate overloading by giving different
names to the different functions; in this sense overloading is
just a convenient syntactic abbreviation."
Rob
SCJP 1.4
Originally posted by Michael Ernest:
I think I hold with the idea of 'shallow' polymorphism. Overloading I can see as a kind of word variant to the original message. When we consider that overloaded methods can indeed appear in subclasses as supplments to the original method, it seems reasonable enough to me.
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Originally posted by Thomas Paul:
If polymorphism means whatever we want it to mean then the word serves no useful purpose.
But the word serves a very useful purpose. When I am in a technical discussion I want to use words like polymorphism and singleton and proxy to mean specific things.
That is why I am so strongly opposed to this incorrect usage of the term.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
From here
Languages (natural and programming languages included) are not rigorous science, a lot of human factors are involved. To programming languages, another factor is the cost.
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
"I'm not back." - Bill Harding, Twister
Originally posted by Jim Yingst:
on the other, the misuse is so prevalent that even those who know the correct definition must also be aware of the false one, and be prepared to a bit of mental translation when speaking to philistines.![]()
Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |