Pages

July 25, 2010

Review OOP244 - Modular Programs

3 concepts applies to designing classes
Encapsulation, Inheritance, Polymorphism


What Does Compiler Do?
  1. the pre-processor inserts the contents of the header files into the implementation file for each module and substitutes all #define strings to create a single source file ready for compilation
  2. the compiler properly compiles each pre-processed source file and create a binary file
  3. the linker assembles the binary files for the application with the library binary files to form a single executable file
Summary
  • an application may be divided into a number of independent components: these components are called modules
  • a different module can be defined for each class in an application due to the encapsulated nature of the class
  • preparation of an executable file entails three separate stages: pre-processing, compilation and linking
  • each module consists of a header file and an implementation file and is pre-processed and compiled independently
  • a module's header file contains the declarations of the module's names without definitions or any executable statements
  • a module's implementation file contains the definitions of the module's functions
  • for compilation, a module's implementation file only needs to include the header files of those modules that contain declarations of the names referred to in the implementation file itself

No comments:

Post a Comment