> > |
%META:TOPICINFO{author="TimurZambalayev" date="1054743960" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="TimurZambalayev"}%
"Casting from a bse class to a derived class is often called a downcast because of the convention of drawing inheritance trees growing from the root down." (Bjarne Stroustrup. The C++ Programming Language. Special 3rd Edition. Section 15.4, page 408).
"Why “upcasting”? The reason for the term is historical, and based on the way class inheritance diagrams have traditionally been drawn: with the root at the top of the page, growing downward. (Of course, you can draw your diagrams any way you find helpful.) [...] Casting from a derived type to a base type moves up on the inheritance diagram, so it’s commonly referred to as upcasting." (Bruce Eckel. Thinking In Java. 3rd Edition)
See also http://www.refactoring.com/catalog/pushDownMethod.html and http://www.refactoring.com/catalog/pullUpMethod.html
-- TimurZambalayev - Jun 04, 2003 |