stevemacn / bridgesAPI

Data delivery system for multiple data sources (Twitter, Rotten Tomatoes, etc).
MIT License
5 stars 5 forks source link

Refactor data-source factories. #19

Open stevemacn opened 10 years ago

stevemacn commented 10 years ago

The current model for data cached from the data-sources is very twitter-centric. Project deadlines prevented me from going back to fix this but moving forward fixing this is essential. A simplified model and simplified factory will make it trivial to add new data-sources and make maintenance easier.

What needs to happen:

  1. Query parameters for data-sources should be stored in an array of mixedType and variable size.
  2. Query parameters can therefore be different depending on data-source.
  3. Query parameters are compared to the cached parameters (if they are less than, retrieve from cache).
  4. Streams.js - the factory should be streamlined to handle all the cache comparisons rather than deferring this responsibility to each of the individual data-sources. (This should be overridable).