Let's say I have an object that happens to contain two references to the same contained object (e.g. object.ReferenceEquals(obj1, obj2) will return true).
Now I serialize this object across the data portal and it is deserialized on the application server.
Do I get two copies of the contained object, or is the framework actually smart enough to reproduce the original situation with two references to one copy of the object?
I'm not 100% sure about the answer but I'm going to guess it's smart enough to give you two references to the one copy.
That's an interesting question though.
The BinaryFormatter and NetDataContractSerializer both preserve the shape of the object graph. So they are smart enough to handle this.
Be aware that n-level undo is not that smart though, so you could end up with some really odd edit level scenarios if you aren't careful.
CSLA 3.5 introduced the field manager, which is what allows CSLA
to automatically manage child events.
Marking the duplicate child reference as NonSerialized is not a
bad idea, because it probably reduces the size of the serialized byte stream.
But you will need to reestablish the child reference yourself in
OnDeserialized.
Rocky
Copyright (c) Marimer LLC