All books

Professional

Apps About Coach Log in Start reading

Computer Science · Glossary

What is Interface, implementation?

Also known as: interface · implementation · interface (of a module) · implementation (of a module)

Definition 20.2 High School Computer Science · Chapter 20 — Modules, Interfaces and Libraries

The interface of a module is what its users may rely on: the names it offers and, for each, a specification. The implementation is the code that keeps these promises, and everything else in the module: helpers, data structures, imported modules.

The interface as a wall. Above it, five names with their specifications, the same in the three modules; below it, three ways of keeping the dates, which users never see.
The interface as a wall. Above it, five names with their specifications, the same in the three modules; below it, three ways of keeping the dates, which users never see.
Read in context →
Definition 7.2 University Computer Science — Year 1 · Chapter 7 — Modular Programs, Makefiles and Tests

The interface of a module is what its users may rely on: in C, the declarations of its header and the comments that state their contracts. Its implementation is everything else: the definitions in its .c file, which may change without any user changing.

Read in context →