[INACTIVE] A search and discovery app for the "here & now". We're experimenting with ideas on mobile that can better surface content from the open web.
A big diff, but most of this is straightforward refactoring that moves the Firebase data extraction from Place.swift into the new PlaceProviders.swift. This creates a new protocol, PlaceProvider, that contains all of the fields a provider might have. Note that all fields are optional, so there's no requirement that any provider gives any particular fields.
The primary implementation of this protocol is SourcePlaceProvider, which pulls provider info from the Firebase dict (most of this was simply taken from the Place initializer). The other implementation is the CompositePlaceProvider, which takes a list of providers (ordered by priority) and sets each field based on the first source where it's available. Since Yelp is currently the only provider for each place, the CompositePlaceProvider will just be a mirror of Yelp results, but this will of course change once TA/Wikipedia are added.
Once we have our CompositePlaceProvider, we can populate our Place fields as normal. Like before, we require that we have at least an ID, name, and lat/long pair for a place.
Note: I think Yelp data will divided into both Yelp v2 and Yelp v3 data in Firebase (under providers/yelp and providers/yelpv3), where we currently have only v2 data. I don't think we want separate Yelp v2/v3 providers exposed in a Place, though, so I expect that once we have v3 data, yelpProvider will itself be a CompositePlaceProvider populated from the providers/yelp and providers/yelpv3 branches.
A big diff, but most of this is straightforward refactoring that moves the Firebase data extraction from
Place.swift
into the newPlaceProviders.swift
. This creates a new protocol,PlaceProvider
, that contains all of the fields a provider might have. Note that all fields are optional, so there's no requirement that any provider gives any particular fields.The primary implementation of this protocol is
SourcePlaceProvider
, which pulls provider info from the Firebase dict (most of this was simply taken from thePlace
initializer). The other implementation is theCompositePlaceProvider
, which takes a list of providers (ordered by priority) and sets each field based on the first source where it's available. Since Yelp is currently the only provider for each place, theCompositePlaceProvider
will just be a mirror of Yelp results, but this will of course change once TA/Wikipedia are added.Once we have our
CompositePlaceProvider
, we can populate ourPlace
fields as normal. Like before, we require that we have at least an ID, name, and lat/long pair for a place.Note: I think Yelp data will divided into both Yelp v2 and Yelp v3 data in Firebase (under
providers/yelp
andproviders/yelpv3
), where we currently have only v2 data. I don't think we want separate Yelp v2/v3 providers exposed in aPlace
, though, so I expect that once we have v3 data,yelpProvider
will itself be aCompositePlaceProvider
populated from theproviders/yelp
andproviders/yelpv3
branches.