13.8 Component library
In previous examples, we have shown how the <angle> class can use the <sixty-unit> class as a base class. We could have simply included the <angle> class in our time library (presumably calling it a time-and-angle library), but it seems plausible that clients might not want both classes all the time. Another organization would be to make an angle library that uses the time library, which would be burdensome only to clients who want angles without time. Clearly, the right solution is to make a separate sixty-unit library that is shared by the time and angle libraries.
Because we had already broken out sixty-unit into a separate module and file, we can create this new organization by
Moving the
sixty-unitmodule to its own library fileUpdating the
timelibrary fileOpening the
<sixty-unit>class
Note that no changes are required to the time implementation file, so we do not present it again.




