Avoid deep nesting in lightweight objects

Whether you use an object or inherit from it, there's a finite cost. The object you use or inherit from must be constructed or destructed every time your object is constructed or destructed. Usually, that means a function call. Make sure that lightweight objects intended to be created or destroyed quickly do not use deeply nested inheritance or many embedded objects with constructors.

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker