Sponsored Link •
Table of Contents For
API Design with Java
by Bill Venners
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
Chapter 2. Classes, Inheritance, and Composition
- Guideline 9: Use classes primarily to serve as blueprints
- Guideline 10: Use concrete classes to say "What objects are."
- Guideline 11: Use composition enlist the help of other
- Guideline 12: Use class extension to model permanent
- Guideline 13: Understand the difference between inheritance and
interfaces and Abstract Classes
- Guideline 14: Appreciate the significance of the
- Guideline 15: Use
interfaces 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
- 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.
About the Author
I welcome all comments about this work-in-progress. Please e-mail
your comments to firstname.lastname@example.org,
or sound off in the Flexible Java