Lukas Renggli wrote:
> Yes, it was incorrect question. I mean the moment right after
> it's aspects values after user filled the form and pressed 'Saved'...
> I mostly interested this moment right after new object was added. But it's
> quite obvious to implement.
You can override #write:using: in any model object to intercept the
writing of values.
If you load
Magritte-RealMemento (a dependent of Magritte-Scriptaculous) it implements:
Object:#commit: - dummy implementation
MACheckedMemento-#commit to send #commit: to the model.
It also has its own memento implementation which uses for the memento, a
copy of the original object (including behaviour) rather than a
dictionary of key-values.
I combine this with the client-framework, for pluggable front and back
ends. So commit: calls
self client autoCommitSomeObjectClass: self
db autoCommitSomeOnectClass: anObject
This gives you enough hooks to provide customisable behaviour
per-client-installation and per-database-backend, including mock
behaviour for testing.