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)
“The construction of life is at present in the power of facts far more than convictions.”
—Walter Benjamin (18921940)
“The militancy of men, through all the centuries, has drenched the world with blood, and for these deeds of horror and destruction men have been rewarded with monuments, with great songs and epics. The militancy of women has harmed no human life save the lives of those who fought the battle of righteousness. Time alone will reveal what reward will be allotted to women.”
—Emmeline Pankhurst (18581928)