AnansiPodcast / charlie

Fetch, parse and handle Podcasts XMLs and Episodes
MIT License
0 stars 0 forks source link

Anansi SDK #10

Open sergiopvilar opened 8 years ago

sergiopvilar commented 8 years ago

This issue has the purpose to describe the idea behind the Anansi SDK and discuss how the idea should be implemented in general lines.

What's Anansi's SDK? The main objective by building an SDK for Anansi is to concentrate the common implementation of all Anansi clients.

Which implementation will be migrated to Anansi SDK? Everything that doesn't handles UI:

The thing here is that each client uses different implementations for database. Desktop uses lowdb, mobile uses AsyncStorage and so. The idea to handle this database issue is that each client will have an Adapter passed as parameter to each SDK handler, something like this.

So SDK will call adapters to read and write in the database.

Proposal of architecture to build SDK handlers: Architecture

joeljuca commented 8 years ago

What does MyHandler.adapter() do?

sergiopvilar commented 8 years ago

@joelwallis sets the adapter as this example shows.

sergiopvilar commented 8 years ago

I'm starting to think that clients should save Adapters directly to AdapterRegistry.

joeljuca commented 8 years ago

@sergiovilar can you describe the current architecture components (handlers, adapters, registries, repositories and the entities itself) and how they interact with each other?

sergiopvilar commented 8 years ago

@joelwallis Clients will call a public interface provided by handlers. Handlers will call repositories that will grab adapters registered in AdapterRegistry. See the image above.