Background
See #2 for background.
Problem
The AppModels must be updated according to the refined API spec.
Solution
We've split this analysis into two sections: Lists and properties. Each section lists what's extra and what's missing for each of the three types.
Lists:
Current setup
Publisher
- Projects
- Users
- ParentPublishers
- ChildPublishers
Project
- Collaborators
- Dependencies
- Connections
- Features
- Links
- Images
User
- Connections
- Projects
- Publishers
- Links
Changes to make:
[What's extra]:
Publisher doesn't need:
Project doesn't need:
User doesn't need:
[What's missing]:
Publisher is missing:
- Users + Roles
- Connections
- Links
Project is missing:
User is missing:
- Projects + Roles
- Publisher + Roles
Properties:
Current setup
Publisher
- Owner
- Name
- Description
- Icon
- AccentColor
- ContactEmail
- IsUnlisted
Project
- Publisher
- Name
- Description
- Icon
- HeroImage
- AccentColor
- Category
- CreatedAt
- ForgetMe
- IsUnlisted
User
- Name
- MarkdownAboutMe
- Icon
- ForgetMe
Changes to make:
[What's extra]:
Publisher doesn't need:
Project doesn't need:
User doesn't need:
[What's missing]:
Publisher is missing:
- ExtendedDescription
- ForgetMe
Project is missing:
User is missing:
In addition to property and collection updates, several other changes should be made to the AppModel interfaces while we're in here refactoring things:
- Any mention of
IsPrivate should be updated to IsUnlisted, including comments.
- Identify common properties and collections, then create common interfaces to ensure consistency. Ensure code comments match the generic nature of the common interfaces.
- All usages of CID should be removed and substituted with either an appropriate AppModel interface or a primitive value.
- Ensure that the:
- Read-only AppModel interfaces have:
- For properties:
Task<TGoesHere> Get* for getting values.
- For collections:
IAsyncEnumerable<TGoesHere> for enumerating values.
EventHandler<TGoesHere[]> *Added; and EventHandler<TGoesHere[]> *Removed for tracking changes.
- Modifiable AppModel interfaces have:
- Derived their read-only counterparts.
- For properties:
Update* methods for setting values.
- For collections:
Task Add*Async(TGoesHere, ...) plus Task Remove*Async(TGoesHere, ...) methods for updating values (lists)
- For Dictionaries (Connections only):
- Treat as an enumerable collection of properties, e.g.
KeyValuePair<string, TGoesHere> but just IConnection instead.
- Needs a common sdk-supplied interface to implement and cast down on the consumer's side. Connections use
Kvp<string, DagCid> in the model, but the AppModel cannot expose a Cid and needs an implementable IConnection interface instead.
- Ensure code comment are present and appropriate on public members.
- For any added or removed properties or methods, ensure the corresponding events are also added or removed.
- Ensure cancellation tokens are present and required.
Background
See #2 for background.
Problem
The AppModels must be updated according to the refined API spec.
Solution
We've split this analysis into two sections: Lists and properties. Each section lists what's extra and what's missing for each of the three types.
Lists:
Current setup
Publisher
Project
User
Changes to make:
[What's extra]:
Publisher doesn't need:
Project doesn't need:
User doesn't need:
[What's missing]:
Publisher is missing:
Project is missing:
User is missing:
Properties:
Current setup
Publisher
Project
User
Changes to make:
[What's extra]:
Publisher doesn't need:
Project doesn't need:
User doesn't need:
[What's missing]:
Publisher is missing:
Project is missing:
User is missing:
In addition to property and collection updates, several other changes should be made to the AppModel interfaces while we're in here refactoring things:
IsPrivateshould be updated toIsUnlisted, including comments.Task<TGoesHere> Get*for getting values.IAsyncEnumerable<TGoesHere>for enumerating values.EventHandler<TGoesHere[]> *Added;andEventHandler<TGoesHere[]> *Removedfor tracking changes.Update*methods for setting values.Task Add*Async(TGoesHere, ...)plusTask Remove*Async(TGoesHere, ...)methods for updating values (lists)KeyValuePair<string, TGoesHere>but justIConnectioninstead.Kvp<string, DagCid>in the model, but the AppModel cannot expose a Cid and needs an implementableIConnectioninterface instead.