13: Working With Modules and Class Interfaces

  1. The module's function
    1. A module groups class definitions together, typically those that are functionally related-creating an application of some kind, for example.
    2. Some classes in a module depend on classes in other modules for their definition
    3. Class interfaces allow cross-module class definitions
  2. Class Interfaces
    1. Syntax (same as class definition, but uses "interface" instead of class)
    2. What it means to define features within an interface definition
      1. Feature interfaces only, no methods or properties
    3. Class interfaces are typically generated by the compiler.
  3. Declaring a module
    1. Syntax is the same as presented in the last chapter
    2. Module items can be class declarations and class interfaces intermixed
    3. Class IDs within a module must be different unless two class definitions define the same class
      1. If you use the same ID for two class definitions, the second class definition must be backward compatible-that is, it must expand on the features of the first definition. It can't remove or change the interface of any existing features.
      2. The second of two class definitions with the same ID prevails when the classes are defined.
    4. Order of class definitions within a module isn't important; a class can be defined using a class that aren't defined until later in the module
  4. Use class interfaces to use classes from other modules
    1. Class interfaces may be used within the module to type-spec classes stored in another module.
    2. Built-in classes need not have interfaces within the module.
    3. Class interfaces from a module are typically created with the compiler and stored in .i files.
    4. .i files are typically included in a module using the preprocessor "#include" directive
  5. Sample Code

TS Ref - 26 JUN 1996

Generated by the sweat of Mike Boom's brow.