I’m developing an iOS application where I’m accessing various music streaming services (spotify, r.dio etc.).
For each API I have a so called source manager object (e.g. SpotifySourceManager). These are able to return the playlists (and some other data) for the given service.
I register those source managers in a singleton/shared object (think of a master source manager) which I’m using to aggregate the data from the different services (the playlists itself are wrapped by custom objects implementing a common protocol).
Is there a design pattern name for this setup? I’m asking because I’ve to write a documentation about this and it would be nice to have a name for it.
I already did some research, but unfortunately couldn’t find anything.
Service Provider Framework. From Effective Java:
There are three essential components of a service provider framework: a service
interface, which providers implement; a provider registration API, which the
system uses to register implementations, giving clients access to them; and a service
access API, which clients use to obtain an instance of the service. The service
access API typically allows but does not require the client to specify some criteria
for choosing a provider. In the absence of such a specification, the API returns an
instance of a default implementation.