TOC PREV NEXT INDEX

C++: A Dialog


10.6. More Definitions


A polymorphic object is a C++ object that presents the appearance of a simple object while behaving polymorphically, but without the hazards of exposing the user of the polymorphic object to the pointers used within its implementation. The user of a polymorphic object does not have to know about any of the details of the implementation, but merely creates an object of the single visible class (the manager class). That object does what the user wants with the help of an object of a worker class, which is derived from the manager class.
The manager/worker idiom is a mechanism that allows the effective type of an object to be determined at run time without requiring the user of the object to be concerned with pointers.1
The reference-counting idiom is a mechanism that allows one object (the reference-counted object) to be shared by several other objects (the client objects); thus, a copy needn't be made for each of the client objects.
1
Manager/worker is my name for what James Coplien calls the envelope/letter idiom in his book, Advanced C++: Programming Styles and Idioms (ISBN 0-201-54855-0, Addison-Wesley Publishing Company, Reading, Mass., 1992).


www.steveheller.com
steve@steveheller.com
TOC PREV NEXT INDEX