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)
“Theres no art
To find the minds construction in the face.”
—William Shakespeare (15641616)
“When God desires to destroy a thing, he entrusts its destruction to the thing itself. Every bad institution of this world ends by suicide.”
—Victor Hugo (18021885)