I am working on a nuts-and-bolts* book on object-oriented programming. The intent is to produce a short but practical tutorial and reference for the major concepts, pitfalls, practices, and promises of OOP while staying language-agnostic and steering clear of theoretical esoterica.
Each chapter will be devoted to a single concept or topic (including its limitations as well as its uses and advantages). Some of the obvious ones (so far) are:
- Introduction
- Data
- Code
- Object
- Message
- Method
- How an OO interpreter works
- Late/Dynamic Binding, Static Binding
- Reflection
- Information Hiding
- Classes
- Prototypes
- Encapsulation
- Polymorphism
- Inheritance
- Composition
- Composition vs Inheritance
- Classes vs Prototypes vs Templates vs Macros
- Interfaces
- Contracts
- Generics
- Events
- Exceptions, Callbacks, and Error Handling
- Object Lifecycle
- Design Patterns
- Refactoring
- Unit Testing
- Test-Driven Development
- Behavior-Driven Development
- Domain-Driven Design
- Aspect-Oriented Programming
- Glossary
- Appendices (optional catch-all for related topics, future directions, UML, tools, etc.)
(topics in italics are taken from suggestions below)
What other topics/concepts/chapters would you suggest, and why?
ADDENDUM: suggestions for intended common chapter structure (esp. quotes!) also welcome:
- Chapter title
- Chapter quote - like "What has it got in its pocketses?" -- Gollum, for Encapsulation.
- primer-style overview of concepts built from atoms of previous chapter's concepts
- Short illustrative story or analogy
- More formal definitions, as appropriate
- Brief history or background, as appropriate
- Exposition and illustration
- Obvious uses
- Possible pitfalls and traps
- Practical advice on topic
- Code Examples
I am planning to use a different language for the examples in each chapter, so the book would not be tied to a particular language - C#, C++, Java, SmallTalk, Ruby, Python, Perl, etc. Additional language suggestions welcome also.
ADDENDUM 2: It might be fun to have the 'homework problems' at the end of each chapter lead up to the implementation of a simple OOP scripting language, so the reader will truly understand how OOP works 'under the hood' [hence the title, Object Mechanics].
[* by nuts-and-bolts I mean a practical how-to guide that primarily explains and demonstrates the mechanisms, with minimal theory and math]
UPDATE 2010-07-08: The book is now in progress, but no deadline for completion is set. Thanks again to all who helped me think through this complex and convoluted subject matter, and for all the great suggestions! The first chapter is available, adapted from this SO question answer