Closed Arlodotexe closed 3 days ago
Continuing from here, I've identified a few common interfaces we'll be able to create:
IReadOnlyConnection
Link
(currently under IModifiableEntity
/IReadOnlyEntity
)IReadOnlyPublisher
IReadOnlyProject
IReadOnlyUser
IsUnlisted
related members can be moved into I*Entity
.For each item listed here, we'll need a modifiable and read-only version as previously spec'd: Read-only has get methods+events, modifiable has change methods.
Link
and Role
need to be migrated to an AppModel, as it only exists in Models right now.
Done in #5
Background
See https://github.com/WindowsAppCommunity/WinAppCommunity.Sdk/issues/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:
IsPrivate
should be updated toIsUnlisted
, including comments.Task<TGoesHere> Get*
for getting values.IAsyncEnumerable<TGoesHere>
for enumerating values.EventHandler<TGoesHere[]> *Added;
andEventHandler<TGoesHere[]> *Removed
for tracking changes.Update*
methods for setting values.Task Add*Async(TGoesHere, ...)
plusTask Remove*Async(TGoesHere, ...)
methods for updating values (lists)KeyValuePair<string, TGoesHere>
but justIConnection
instead.Kvp<string, DagCid>
in the model, but the AppModel cannot expose a Cid and needs an implementableIConnection
interface instead.