Cyclic references

Cyclic references

Old forum URL: forums.lhotka.net/forums/t/5114.aspx


jureleskovec posted on Thursday, July 17, 2008

I searched the forum for the posts about cyclic references but found nothing. I also tried to find it in the book but no luck (it occured to me that cyclic references were addressed in the book somewhere).

So, my question is simple: Why the csla doesn't support cyclic references in BO graphs if the BinaryFormatter does which is used by csla's serialization?


-- Jure

RockfordLhotka replied on Thursday, July 17, 2008

This has been discussed on the forum before - but I don't know that anyone used this specific term. I think we used "circular references" or something like that.

There are a couple reasons.

First, while the BinaryFormatter does support the concept, you'll find that the size of the byte stream gets much larger if you have a circular reference in your graph. It is often worth breaking the reference with NonSerialized and reconnecting it on deserialization to avoid that overhead.

Second, n-level undo doesn't use the BinaryFormatter - not to maintain its parent-child relationships anyway. While UndoableBase could perhaps be enhanced to handle this concept, it just has never been a big enough issue to justify the effort that would take. Dealing with circular references is non-trivial (I know - I wrote a serializer from scratch a few years ago), so it would have to be a pretty pressing issue to make it worth the trouble.

Copyright (c) Marimer LLC