Summary

 < Day Day Up > 



Correct, predictable object behavior is essential for the successful implementation of an object-oriented software application. A well-behaved object is one that can be relied upon to perform as if it were a native C++ data type. The degree to which an object should perform like a native data type is context dependent.

When creating complex user-defined types you must be aware of the four primary object contexts: object creation, object copying, object assignment, and object destruction. The orthodox canonical class form (OCCF) can be used to ensure proper class design so that user-defined type objects behave predictably in the four basic object usage contexts.

Four special functions support the OCCF: default constructor, destructor, copy constructor, and copy assignment operator. Additional object usage contexts, such as object comparison, requires the overloading of additional operators. Keeping the OCCF in mind when you create complex user-defined types increases your object usage situational awareness.



 < Day Day Up > 



C++ for Artists. The Art, Philosophy, and Science of Object-Oriented Programming
C++ For Artists: The Art, Philosophy, And Science Of Object-Oriented Programming
ISBN: 1932504028
EAN: 2147483647
Year: 2003
Pages: 340
Authors: Rick Miller

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net