Item[36]
Never redefine an inherited non-virtual function.
Item[37]
Never redefine an inherited default parameter value, because default parameter values are statically bound, while virtual functions — the only functions you should be overriding — are dynamically bound.
Item[38]
Some objects in your programs correspond to things in the world you are modeling, e.g., people, vehicles, video frames, etc. Such objects are part of the application domain. Other objects are purely implementation artifacts, e.g., buffers, mutexes, search trees, etc. These kinds of objects correspond to your software's implementation domain.
-
Composition has meanings completely different from that of public inheritance.
-
In the application domain, composition means has-a. In the implementation domain, it means is-implemented-in-terms-of.
阅读(791) | 评论(0) | 转发(0) |