NotUndoable Managed Properties

NotUndoable Managed Properties

Old forum URL:

Andreas posted on Wednesday, May 12, 2010

Hi Rocky,

I found some forum entries and finaly a BugTracker entry about supporting NotUndoable and NonSerizalized managed properites. Is any chance that it will make it in to Csla4.0? If the answer is no, is there any recommended workaround that can be used inbetween?


RockfordLhotka replied on Wednesday, May 12, 2010

No, this won't be in CSLA 4. Right now the workaround is to use private backing fields for those properties.

Solving the problem turns out to be complex, because it could force the field manager to maintain 4 lists of values:

  1. The normal list like today
  2. A list of values that should be serialized, but not undo
  3. A list of values that should not be serialized, but should undo
  4. A list of values that should not be serialized, and should not undo

I'm not sure I want to accept the overhead of maintaining four lists, and serializing two of them sometimes but not other times, and I just didn't have time to perform such major surgery to the field manager and serialization infrastructure for CSLA 4.

rsbaker0 replied on Wednesday, May 12, 2010

Might it be possible to at least "simulate" NotUndoable by tinkering with the FieldManager undo implementation? 

At least at some level, the only difference between "should undo" and "should not undo" is that if UndoChanges is called, the current value of the property should be discarded in favor of th saved state for an undoable property and not discarded otherwise, so I'd think you could perhaps leave everything the same except ignore NotUndoable properties in the FieldManager when restoring the previous state.

Maybe this is a gross oversimplification, but it might work...

RockfordLhotka replied on Wednesday, May 12, 2010

That's true, NotUndoable probably isn't so bad. NonSerialized is the harder one.

Copyright (c) Marimer LLC