atsign-foundation / at_client_sdk

The Dart implementation of atSDK used for implementing Atsign's technology into other software
https://pub.dev/publishers/atsign.org/packages
BSD 3-Clause "New" or "Revised" License
1.47k stars 31 forks source link

[Tracker] Collections library #796

Open gkc opened 1 year ago

gkc commented 1 year ago

Is your feature request related to a problem? Please describe.

Currently every app developer has to independently implement the glue code required to join their app's domain objects (and lists of those objects) with put/delete calls to the AtClient API on the one hand, and update/delete notifications from the notification service on the other.

Buzz and the insurance poc app are current examples of this. We have an opportunity now to take the learnings from those apps and implement a set of classes which could be used by any app and which will cover the typical 90% which is usually CRUD (Create, Retrieve, Update & Delete) but which for the atPlatform we will cover as SCRUD (Share, Create, Retrieve, Update & Delete)

This leads to a lot of extra effort on the part of developers, with some concepts being non-obvious (e.g. "sharing" with an atSign means calling AtClient.put(sharedAtKey, value) which results in the creation of an entry in the keystore, with the data encrypted specifically for that atSign, and "un-sharing" means calling AtClient.delete(sharedAtKey) where sharedAtKey is something like @bob:12345.addresses.myapp@alice)

Describe the solution you'd like

Set of (generic) classes which provide glue code which could be used by both Buzz and the insurance poc app

Some initial ideas to seed the design conversation

### High-level tasks (please add additional tasks here!)
- [ ] [Clearly define what we want to achieve via design doc and/or code prototype](https://github.com/atsign-foundation/at_client_sdk/issues/797). (Take what's been learned from Buzz and the insurance POC, merge it with some of the ideas / objectives outlined above, write a detailed design doc and/or code prototype and test cases illustrating the things that we want to be true, get it reviewed)
- [x] Defining abstract classes and pseudocode (https://github.com/atsign-foundation/at_client_sdk/issues/826)
- [ ] High-level marketing / launch plan (how do we talk about this, why it's important, why it's cool, how to use it, etc)
  - [ ] Timing Mar 2023
- [ ] Initial implementation
- [ ] Refactor insurance POC to use these new "Collections" abstractions
- [ ] Modify Collections implementations as required based on what didn't fit / wasn't right for the insurance POC
- [ ] Refactor Buzz to use the Collections abstractions
- [ ] Modify Collections implementations as required based on what didn't fit / wasn't right for Buzz
- [ ] "How to" guides on docs.atsign.com
- [ ] Text or video (or both) content for posting on social or our website
XavierChanth commented 1 year ago

Thoughts from an earlier discussion: https://gist.github.com/XavierChanth/f7f92701657db773b5d42158c014d8d4

Meeting minutes 17/11/2022:

To be discussed:

VJag commented 1 year ago

Here is the detailed plan. Idea is to deliver V1 in PR52

Version 1

Version 2

Version 3

sachins-geekyants commented 1 year ago

In this sprint, we have added end-to-end test, refactored code and unit tests, and added docs. Moving to the next sprint.

sachins-geekyants commented 1 year ago

Raised a draft collection PR : https://github.com/atsign-foundation/at_client_sdk/pull/906

If testing is good, we can proceed with merging it.

sachins-geekyants commented 1 year ago

Reducing the SP to 5 for testing.