7 Designing a concise and well-organized API

 

This chapter covers:

  • Organizing an API’s data, feedback, and goals for better understanding
  • Managing the granularity of data, goals, and the API as a whole for better usability

Now that we know how to design straightforward and predictable APIs, we have one last thing to cover in order to be sure we’re designing usable APIs. TV remote controls sometimes look intimidating with their numerous and not always well-organized buttons. Some microwave ovens or washing machines offer far too many functions for mere mortals. Overwhelming, disorganized, indistinct, or motley everyday interfaces at best puzzle their users and at worst frighten them.

"Less is more" and "a place for everything and everything in its place" are two adages that every API designer should apply. Organizing and sizing an API’s data, feedback, and goals is important in order to provide an API that can be understood easily and will not overwhelm users. If this is not done, all that we have learned about creating straightforward and predictable APIs is worth nothing.

7.1  Organizing an API

If you have ever used a TV remote control, you should be able to understand the meaning of any button on the four examples shown in figure 7.1. All of them propose exactly the same functions, using 15 buttons — but depending on the buttons' organization, the usability goes from terrible to perfect.

Figure 7.1. The organization of a TV remote control’s buttons affects its usability.
7.1 remote control

7.1.1  Organizing data

7.1.2  Organizing feedback

7.1.3  Organizing goals

7.2  Sizing an API

7.2.1  Choosing data granularity

7.2.2  Choosing goal granularity

7.2.3  Choosing API granularity

7.3  Summary

sitemap