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

Use single State associated type in item spec #69

Closed
azriel91 opened this issue Jan 12, 2023 · 0 comments · Fixed by #70
Closed

Use single State associated type in item spec #69

azriel91 opened this issue Jan 12, 2023 · 0 comments · Fixed by #70

Comments

@azriel91
Copy link
Owner

Originally, logical and physical states were separated on the basis that implementors must distinguish the two concepts, and diff only happens on the logical state.

However, it is becoming apparent that:

  • The separation of logical and physical state does exist, but certain things only have a logical state, and requiring State<Logical, Physical> everywhere is unnecessary complexity.
  • Consistency of a single state type per item spec has the advantage of:
    • Not needing to go through the state.logical layer in each *Spec function
    • Serialization is consistent (always the same type)
    • Serialization is simplified (no additional layer as well)
  • Implementors may still use State<Logical, Physical> when it makes sense for the item. We should make it easily discoverable in the documentation.

This should be done early since the effort that grows is large per new functionality added to the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant