• Increase font size
  • Default font size
  • Decrease font size

Introducing API Design Principles

by martin on April 11th, 2011

Dr. Jaime Niño of the University of New Orleans has produced teaching materials to support his class on API development. This 6-page document covers a lot of the important API topics, from specification, documentation, design, implementation, and testing. These principles are illustrated with reference to the task of creating an API for data containers. Some of the words of advice include:

  • Make the specification of the data type for the container as generic as possible
  • Specify data containers via interfaces
  • The data container interface must provide a cohesive abstraction
  • Be consistent
  • Be minimal
  • Methods names matter
  • Favor queries
  • Minimize the number of commands
  • Favor parameters’ type specified via interface types
  • Use appropriate parameters and return types
  • Avoid long parameter lists

You can view a PDF of the document here: API Design Principles in CS2.

 

 

From → Design

Comments are closed.

ABOUT THIS SITE

An Application Programming Interface (API) provides a logical interface to a piece of software and hides its internal details. This website is dedicated to a book on designing APIs for C++ and includes articles and links on API development.
 

SOURCE CODE

The book is accompanied by a source code package that contains many of the examples in the text. Download it for free.
 

OTHER BOOKS

Dr. Reddy has also published a computer graphics book called Level of Detail for 3D Graphics. Check it out too!.
 
Copyright (c) 2023 Martin Reddy. All rights reserved. Login