Skip to content

Code-Calculated View Fields#4

Open
mrpmorris wants to merge 3 commits into
masterfrom
CalculatedViewFields
Open

Code-Calculated View Fields#4
mrpmorris wants to merge 3 commits into
masterfrom
CalculatedViewFields

Conversation

@mrpmorris
Copy link
Copy Markdown

This isn't quite working, the calculated view field isn't having the ML framework re-request its value for display and I don't know why.

@mrpmorris
Copy link
Copy Markdown
Author

@patrik-github Did you consider implementing this feature?
I don't need it as I don't do Unity3D any longer, but I just spotted it.

@patrik-u
Copy link
Copy Markdown
Contributor

@patrik-github Did you consider implementing this feature?
I don't need it as I don't do Unity3D any longer, but I just spotted it.

Hi I appreciate your interest. Right now the framework is being rewritten from scratch using code-generation and (proper) dependency properties - not sure what a code-calculated field is, have you examples how this is intended to be used? Might be something I'd want to keep in mind.

@mrpmorris
Copy link
Copy Markdown
Author

It's like a memento.

  1. The consumer tries to read the value, it isn't set in its cache so it should calculate it and store the result in its cache.
    2: The consumer tries to read the value again, the cached value should be returned to avoid potentially expensive calculation.
  2. If any value that this is dependent on are altered it should invalidate its cache, but not recalculate.

This way you have a value than might be computationally expensive that can be read multiple times very quickly because it is cached, but that isn't calculated unless A) It is demanded and B) The cached value is suspected to be stale.

My code might not be ideal because I had to try to patch it into existing code.

@patrik-u
Copy link
Copy Markdown
Contributor

I see, that is useful. Thanks for the explanation.

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 this pull request may close these issues.

2 participants