API 用户实现方法的术语
Terminology for an API where users implement methods
库 API 设计中有一种方法,用户必须实现子 class(或者,有时,一组函数)才能使用 API。例如,库可能会提供一个(抽象的)基础 class,用户必须对其进行扩展、实例化,然后传回给库。
这种方法有具体的名称吗?
(短语"Service Provider Interface"似乎出现在Java中但没有出现在其他地方。它也广泛用于"Plug-in"架构但似乎不是一回事。)
术语抽象在编程社区中有一个精确的众所周知的定义,所以我想我们可以说
We provide an abstract API consisting of a set of abstract classes
and interfaces designed for you to extend and customise with concrete
implementations.
而且大多数开发人员都会熟悉预期的含义。
库 API 设计中有一种方法,用户必须实现子 class(或者,有时,一组函数)才能使用 API。例如,库可能会提供一个(抽象的)基础 class,用户必须对其进行扩展、实例化,然后传回给库。
这种方法有具体的名称吗?
(短语"Service Provider Interface"似乎出现在Java中但没有出现在其他地方。它也广泛用于"Plug-in"架构但似乎不是一回事。)
术语抽象在编程社区中有一个精确的众所周知的定义,所以我想我们可以说
We provide an abstract API consisting of a set of abstract classes and interfaces designed for you to extend and customise with concrete implementations.
而且大多数开发人员都会熟悉预期的含义。