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:
“I cannot be much pleased without an appearance of truth; at least of possibilityI wish the history to be natural though the sentiments are refined; and the characters to be probable, though their behaviour is excelling.”
—Frances Burney (17521840)
“No construction stiff working overtime takes more stress and straining than we did just to stay high.”
—Gus Van Sant, U.S. screenwriter and director, and Dan Yost. Bob Hughes (Matt Dillon)
“There are risks which are not acceptable: the destruction of humanity is one of them.”
—Friedrich Dürrenmatt (19211990)