GCO4020/CSC428 - Advanced Object Oriented Techniques In C++
Week 3

 

Topic 5: Hiding Implementation Details

Exercises


Synopsis


Exercise 1

  1. List the advantages of this technique for separating interface¤ and implementation¤.

  2. List the drawbacks of the technique.

There is a sample solution for Exercise 1.


Exercise 2

Suggest another way in which the MappingImpl class might be implemented (hint: suppose each MappingImpl object shared a common STL¤ container). Indicate the circumstances in which your alternative might be preferable.

There is a sample solution for Exercise 2.


Exercise 3

It is possible to eliminate the need for the Mapping::~Mapping destructor entirely. Suggest how this might be achieved.

There is a sample solution for Exercise 3.


Exercise 4

Explain why the speed increases which are possible when using references are referred to as only a "potential" benefit?

There is a sample solution for Exercise 4.

 


This material is part of the GCO4020/CSC428 - Advanced Object Oriented Techniques In C++ course.
Copyright © Damian Conway, 1997. All rights reserved.

Last updated: Fri Feb 18 11:17:16 2000