Open sergiopvilar opened 8 years ago
What does MyHandler.adapter()
do?
@joelwallis sets the adapter as this example shows.
I'm starting to think that clients should save Adapters directly to AdapterRegistry.
@sergiovilar can you describe the current architecture components (handlers, adapters, registries, repositories and the entities itself) and how they interact with each other?
@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.
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: