O'Reilly logo

C Interfaces and Implementations: Techniques for Creating Reusable Software by David R. Hanson - Princeton University

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Interfaces and Implementations

A module comes in two parts, its interface and its implementation. The interface specifies what a module does. It declares the identifiers, types, and routines that are available to code that uses the module. An implementation specifies how a module accomplishes the purpose advertised by its interface. For a given module, there is usually one interface, but there might be many implementations that provide the facilities specified by the interface. Each implementation might use different algorithms and data structures, but they all must meet the specification given by the interface.

A client is a piece of code that uses a module. Clients import interfaces; implementations export them. Clients need to see ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required