全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Interface, implementation?

又称: interface · implementation · interface (of a module) · implementation (of a module)

Definition 20.2 High School Computer Science · 第 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.
在原文中阅读 →
Definition 7.2 University Computer Science — Year 1 · 第 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.

在原文中阅读 →