Hi,
When editing a structure, accessors are called via Magritte but there
is no way for the structure to reinitialize itself before any accessor
is called, or to re-establish its invariant after all accessors have
been called.
I thought I'd wrap PRCommand>>doExecute with something like self
structure willEdit and self structure didEdit, would that make sense?
I also saw PRStructure>>validateCommand which shouldn't modify the
structure, but in my case (Citezen) validating means parsing that
takes time and I'd prefer not to repeat that work when committing the
edition to the structure.
I think writing this helped me see a solution:
- validation does the heavy parsing and stores result in (an adhoc
subclass of) the edit command
- executing the command stores parsed data in the structure and resets
the final data
- a lazy accessor for the final data builds it and ditches the parsed data
hopefully that was clear… if you have suggestions…
--
Damien Pollet
type less, do more [ | ]
http://typo.cdlm.fasmz.org