What is the difference between Service Provider Interface (SPI) and Application Programming Interface (API)?
More specifically, for Java libraries, what makes them an API and/or SPI?
In a computer, a serial peripheral interface (SPI) is an interface that enables the serial (one bit at a time) exchange of data between two devices, one called a master and the other called a slave . An SPI operates in full duplex mode.
The service provider API provides custom connectors. The connectors can be used from the IBM® Security Identity Manager provisioning platform or any other Java-based provisioning platform that supports the same interface.
Service provider interface (SPI) is an API intended to be implemented or extended by a third party. It can be used to enable framework extension and replaceable components.
SPI stands for Service Provider Interface and it's a standard Java way to plugin additional functionality as a service discovery mechanism - You can read more about it here SPI basics.
Put differently, the API tells you what a specific class/method does for you, and the SPI tells you what you must do to conform.
Usually API and SPI are separate. For example, in JDBC the Driver
class is part of the SPI: If you simply want to use JDBC, you don't need to use it directly, but everyone who implements a JDBC driver must implement that class.
Sometimes they overlap, however. The Connection
interface is both SPI and API: You use it routinely when you use a JDBC driver and it needs to be implemented by the developer of the JDBC driver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With