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

Refactor Tokenizable storage #1

Open
plv opened this issue Aug 17, 2020 · 0 comments
Open

Refactor Tokenizable storage #1

plv opened this issue Aug 17, 2020 · 0 comments

Comments

@plv
Copy link
Owner

plv commented Aug 17, 2020

Currently, Inodes store Tokenizable:

  • Directory stores them so that future children can inherit this tokenizer.
  • Document stores them because Document is also Tokenizable.

However, this can be roundabout. As my comment in Inode.kt explains:

// TODO:  Storing a Tokenizable in each Directory and Document is a bad idea. It wastes space with no real time benefits
// (esp. if API users may supply a tokenizer that is not a singleton). Also, this can leak if we accidentally keep
// references to a Tokenizable that is also a Document, even after we remove the Document from the DocumentStore.
// I'm crunched for time as of writing this comment, but the smarter thing to do would be to dynamic dispatch
// using a map of some sort.
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

No branches or pull requests

1 participant