Skip to content

Conversation

@Bilge
Copy link
Member

@Bilge Bilge commented Jul 4, 2017

The documentation notes the job of providers is to supply resources with a valid connector, but the interface specified a fetch method, which has little to do with connectors. Now the interface clearly states the intention of the provider removing the fetch method and replacing it with getConnector.

This refactor allows us to completely remove AbstractProvider and boil providers down to a functional interface. This means data is no longer fetched via providers at all; data is fetched directly from resources and providers do nothing more than supply a connector, greatly simplifying the system and removing the burden on implementations to extend an abstract base.

Added optional ProviderOptions interface for providers wishing to pass options to resources.

TODO: consider passing the resource to Provider::getConnector. This would allow providers to send different connectors to different resources. Currently no such use case exists but it is conceivable a provider might have multiple APIs with different connectivity requirements so we should probably include support for this. Alternatively we could insist that a provider with multiple APIs should be implemented as multiple providers.

Changed Provider interface to require getConnector method instead of fetch.
@Bilge Bilge added this to the 4.0.0 milestone Jul 4, 2017
@Bilge Bilge force-pushed the remove-abstract-provider branch from 5bb48a0 to 02a8131 Compare July 12, 2017 22:13
@Bilge Bilge merged commit 02a8131 into 4.0 Oct 25, 2017
@Bilge Bilge deleted the remove-abstract-provider branch April 9, 2018 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants