artima.com

Chapter 1 of API Design
The Object
Guideline 4. Think of objects as machines
by Bill Venners

Part 13 of 21

Advertisement

Usability and Complexity

To a great extent, API design is about taming complexity. Each API should be focused on one area of responsibility. Each area of responsibility involves some inherent level of complexity. Your goal in designing an API is to tame that complexity so that client programmers need not immerse themselves in it. To the extent possible, you want to hide complexity behind APIs that are easy for client programmers to understand. You tame the complexity of an area of responsibility by creating an API that client programmers find easy to learn and use.

The extent to which you can tame complexity depends in part on the nature of your API's area of responsibility. The level of complexity inherent in many areas of responsibility is so great that you could never devise an API which client programmers could use with only a quick glance at the documentation. I wouldn't expect to be able to sit down in an airplane cockpit, for example, and operate that machine without substantial training time. Likewise, I wouldn't expect to be able to use an API dealing with encryption without spending some time learning about cryptology. Taming complexity doesn't mean making everything simple. It means making everything as simple as possible.

Part 13 of 21

API Design | Contents | Book List | Printer Friendly Version | Previous | Next

Last Updated: Friday, April 26, 2002
Copyright © 1996-2002 Artima Software, Inc. All Rights Reserved.
URL: http://www.artima.com/apidesign/object13.html
Artima.com is created by Bill Venners