|
|
|
|
|
|
|
stituent files of a multifile program. With project files, the system automatically recompiles or relinks any files that have become out-of-date because of changes to other files of the program. |
|
|
|
|
|
|
|
|
Whichever environment you usethe command-line environment or an integrated environmentthe overall process is the same: you compile the individual source code files into object code, link the object files into an executable program, then execute the program. |
|
|
|
|
|
|
|
|
Before leaving the topic of multifile programs, we stress an important point. Referring to Figure 15-7, the files timetype.h and timetype.obj must be available to users of the TimeType class. The user needs to examine timetype.h to see what TimeType objects do and how to use them. The user must also be able to link his or her program with timetype.obj to produce an executable program. But the user does not need to see timetype.cpp. The implementation of TimeType should be treated as a black box. The main purpose of abstraction is to simplify the programmer's job by reducing complexity. Users of an abstraction should not have to look at its implementation to see how to use it, nor should they write programs that depend on implementation details. In the latter case, any changes made to the implementation could break the user's programs. In Chapter 7, the Software Engineering Tip box entitled Conceptual Versus Physical Hiding of a Function Implementation discussed the hazards of writing code that relies on implementation details. |
|
|
|
|
|
|
|
|
 |
|
|
|
|
|
|
|
|
Figure 15-7
Linking with the TimeType Implementation File |
|
|
|
|
|