Behaviour During Construction and Destruction
Languages differ in their behaviour while the constructor or destructor of an object is running. For some languages, notably C++, the virtual dispatching mechanism has different semantics during construction and destruction of an object. While it is recommended that virtual function calls in constructors should be avoided for C++, in some other languages, for example C# and Java, the derived implementation can be called during construction and design patterns such as the Abstract Factory Pattern actively promote this usage in languages supporting the ability.
Read more about this topic: Virtual Function
Famous quotes containing the words behaviour, construction and/or destruction:
“The quality of moral behaviour varies in inverse ratio to the number of human beings involved.”
—Aldous Huxley (18941963)
“No real vital character in fiction is altogether a conscious construction of the author. On the contrary, it may be a sort of parasitic growth upon the authors personality, developing by internal necessity as much as by external addition.”
—T.S. (Thomas Stearns)
“We may be witnesses to a Biblical prophecy come true. And there shall be destruction and darkness come upon creation, and the beasts shall reign over the earth.”
—Ted Sherdeman. Gordon Douglas. Dr. Medford (Edmund Gwenn)