Table of Contents For
API Design with Java
by Bill Venners
Advertisement
|
Contents
Preface
Acknowledgments
Introduction
Chapter 1. The API
- Guideline: Focus on interface, not implementation.
- Guideline: Design for the user, not for yourself.
- Guideline: Keep methods, objects, and packages focused.
- Guideline: Design to prevent client mistakes.
- Guideline: What to leave in, what to leave out.
- Guideline: Make common things easy, rare things possible.
- Guideline: Make the semantic contract as explicit as possible.
- Guideline: Make sure subtypes fulfill the semantic
contracts of their supertypes.
- Guideline: Avoid optional clauses in semantic
contracts.
Chapter 2. Classes, Inheritance, and Composition
- Guideline 9: Use classes primarily to serve as blueprints
for objects.
- Guideline 10: Use concrete classes to say "What objects are."
- Guideline 11: Use composition enlist the help of other
objects.
- Guideline 12: Use class extension to model permanent
IS-A relationships.
- Guideline 13: Understand the difference between inheritance and
composition.
Chapter 3. interface
s and Abstract Classes
- Guideline 14: Appreciate the significance of the
interface
.
- Guideline 15: Use
interface
s to define
large families or to say "What objects can do."
- Guideline 16: Use
interface
extension to
decouple services or restrict the semantic contract.
- Guideline 17: Consider creating convenience implementations of your
interface
s.
- Guideline 18: Use abstract classes to provide default behavior or establish a small family.
Chapter 4. Design Patterns
- Guideline 19: Understand the role of intent in design patterns.
- Guideline 20: Use Decorators to avoid hierarchy explosion.
- Guideline 21: Use Proxies to control access to objects.
- Guideline 22: Use Iterators to provide access to the elements of a collection.
- Guideline 23: Use Chain of Responsibility to delegate along a linked list of objects.
- Guideline 24: Use Strategies to pass algorithms to objects.
- Guideline 25: Use Commands to pass requests to objects.
- Guideline 26: Use Event Generators for asynchronous notification.
- Guideline 27: Use the Composite Pattern to treat objects and collections uniformly.
- Guideline 28: Use Factories to delegate the production of objects.
- Guideline 29: Use Template Methods to delegate to subclasses.
Index
About the Author
I welcome all comments about this work-in-progress. Please e-mail
your comments to bv@artima.com,
or sound off in the Flexible Java
Forum.