OOC:en:Content

来自 ChinaUnix Wiki

返回

目录

Preface

Abstract Data Types — Information Hiding

Data Types

Abstract Data Types

An Example — Set

Memory Management

Object

An Application

An Implementation — Set

Another Implementation — Bag

Summary

Exercises

Dynamic Linkage — Generic Functions

Constructors and Destructors

Methods, Messages, Classes and Objects

Selectors, Dynamic Linkage, and Polymorphisms

An Application

An Implementation — String

Another Implementation — Atom

Summary

Exercises

Programming Savvy — Arithmetic Expressions

The Main Loop

The Scanner

The Recognizer

The Processor

Information Hiding

Dynamic Linkage

A Postfix Writer

Arithmetic

Infix Output

Summary

Inheritance — Code Reuse and Refinement

A Superclass — Point

Superclass Implementation — Point

Inheritance — Circle

Linkage and Inheritance

Static and Dynamic Linkage

Visibility and Access Functions

Subclass Implementation — Circle

Summary

Is It or Has It? — Inheritance vs. Aggregates

Multiple Inheritance

Exercises

Programming Savvy — Symbol Table

Scanning Identifiers

Using Variables

The Screener — Name

Superclass Implementation — Name

Subclass Implementation — Var

Assignment

Another Subclass — Constants

Mathematical Functions — Math

Summary

Exercises

Class Hierarchy — Maintainability

Requirements

Metaclasses

Roots — Object and Class

Subclassing — Any

Implementation — Object

Implementation — Class

Initialization

Selectors

Superclass Selectors

A New Metaclass — PointClass

Summary

The ooc Preprocessor — Enforcing a Coding Standard

Point Revisited

Design

Preprocessing

Implementation Strategy

Object Revisited

Discussion

An Example — List, Queue, and Stack

Exercises

Dynamic Type Checking — Defensive Programming

Technique

An Example — list

Implementation

Coding Standard

Avoiding Recursion

Summary

Exercises

Static Construction — Self-Organization

Initialization

Initializer Lists — munch

Functions for Objects

Implementation

Summary

Exercises

Delegates — Callback Functions

Callbacks

Abstract Base Classes

Delegates

An Application Framework — Filter

The respondsTo Method

Implementation

Another application — sort

Summary

Exercises

Class Methods — Plugging Memory Leaks

An Example

Class Methods

Implementing Class Methods

Programming Savvy — A Classy Calculator

Summary

Exercises

Persistent Objects — Storing and Loading Data Structures

An Example

Storing Objects — puto()

Filling Objects — geto()

Loading Objects — retrieve()

Attaching Objects — value Revisited

Summary

Exercises

Exceptions — Disciplined Error Recovery

Strategy

Implementation — Exception

Examples

Summary

Exercises

Forwarding Messages — A GUI Calculator

The Idea

Implementation

Object-Oriented Design by Example

Implementation — Ic

A Character-Based Interface — curses

A Graphical Interface — Xt

Summary

Exercises


Appendix A ANSI-C Programming Hints

Names and Scope

Functions

Generic Pointers — void *

const

typedef and const

Structures

Pointers to Functions

Preprocessor

Verification — assert.h

Global Jumps — setjmp.h

Variable Argument Lists — stdarg.h

Data Types — stddef.h

Memory Management — stdlib.h

Memory Functions — string.h

Appendix B The ooc Preprocessor — Hints on awk Programming

Architecture

File Management — io.awk

Recognition — parse.awk

The Database

Report Generation — report.awk

Line Numbering

The Main Program — main.awk

Report Files

The ooc Command

Appendix C Manual

Commands

Functions

Root Classes

GUI Calculator

个主工具