csla
csla copied to clipboard
n-level undo should be serializer-neutral
Right now, the n-level undo code in UndoableBase has some direct dependencies on MobileFormatter.
That should be changed to rely on the configured serializer.
FWIW this issue is how I found it. Basically, during BeginEdit(), the configured formatter is given a BusinessRules instance, but since my formatter doesn't see it implement the custom interface I think it should, it failed.
I added code to fall back to MobileFormatter in this case, but this really shouldn't be needed. I wonder if this issue would be the key to rectifying this, at least partially.
@JasonBock I think we can totally have UndoableBase call the configured serializer. But I don't know if that'll help you because we are probably serializing types internal to CSLA, so they can't be decorated with attributes or interfaces from external libraries like your serializer.
Would it really work for UndoableBase to invoke your serializer on a type that you wouldn't recognize as a serializable type?