Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sector data store #889

Closed
15 of 22 tasks
dalyIsaac opened this issue May 12, 2024 · 0 comments
Closed
15 of 22 tasks

Sector data store #889

dalyIsaac opened this issue May 12, 2024 · 0 comments
Labels
enhancement New feature or request refactor The code can be simplified/moved/cleaned up

Comments

@dalyIsaac
Copy link
Owner

dalyIsaac commented May 12, 2024

This is a revised version of #859.

Overview

There is an IStore which contains Whim's state. The IStore has:

  • a Dispatch method to perform updates to the state, using Transform implementations
  • a Pick method to retrieve data from the state

Mutability

The IStore can only be updated via Transforms being Dispatched to it. Within the IStore, all items are immutable.

Sectors

The IStore will consist of the following sectors:

  • MonitorSector
  • WindowSector
  • MapSector
  • WorkspaceSector
  • CommandSector
  • RouterSector
  • FilterSector

Managers will remain to facilitate plugins and native calls.

External API

Transforms and Pickers will use handles or IDs. Results will be used to return errors.

Internal API

Defaults will be preferred over nullables for IDs:

public void BobTransform(WorkspaceId id = default)
{
    id = id.OrActiveWorkspace();
}

Transition

During the transition, Whim classes like Workspace, WorkspaceManager, Monitor etc. will deprecate methods as Transforms and Pickers become available. These classes will also become immutable over time.

Threading

The IStore will be protected by a reader-writer lock - see #849

Events

Events will be triggered at the end of each transform. DoLayout will be triggered at the end of the first transform to be called, before any events are triggered.

Plan

Potential Changes

  • CommandSector
  • RouterSector
  • FilterSector

Questions

  • Solicit thoughts on the new API.
    • I'm guessing that the older API is nicer.
    • Maintaining a frontend from the API will get old.
    • One option would be to have both, like a "beginner" and "experienced" API?
  • When removing the IInternal* APIs, should there still be some sort of mockable API?
@dalyIsaac dalyIsaac added this to Whim May 12, 2024
@dalyIsaac dalyIsaac converted this from a draft issue May 12, 2024
@dalyIsaac dalyIsaac added enhancement New feature or request refactor The code can be simplified/moved/cleaned up labels May 12, 2024
@dalyIsaac dalyIsaac moved this from Triage to In Progress in Whim May 12, 2024
dalyIsaac added a commit that referenced this issue May 12, 2024
Bump Whim version to 0.6.0, preparation for #889.
@github-project-automation github-project-automation bot moved this from In progress to Done in Whim Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor The code can be simplified/moved/cleaned up
Projects
Status: Done
Development

No branches or pull requests

1 participant