From what I
could see it looks like a blank field will be interpreted as a
nil, which means
that the domain would need to check for nil in accessors
and return a default.
Another option which I tried is to rather change MAMemento>>push: to make
use of the #default: magritte description.
I.e. when creating your MAStringDescription send the /#default: ''/ message
then change MAMemento as per below so that if the memento cached value is
nil, rather return the default value for the description (which by default
is nil, MADescription class>>defaultDefault)
The way we handle instance variables thoughout our system is to
initialize with a default value (eg. empty string) and allow direct
instVar access. If we do the nil check in accessors (an acceptable
strategy I think), the we change this approach, and that is a bit of
work.
The default approach does not work on empty strings as it bypasses the
default code directly in the method that I mentioned here.