Hallelujah – Entity Graphs will be XML serializable

In the EF forums, Danny Simmons lets an EF RTM cat out of the bag.

And, this looks like it has the possibility to be bigger than just for EF. The EF team worked with the WCF team to make ENTIRE GRAPHS serializable, and in an interoperable way. If you look at Ruurd Boeke’s blog post,Circular references with WCF: solved a different way, about how he  achieved this, you can see examples of how WCF serialized entities before (non-interoperable) and after his own tweaks. Ruurd has been thinking about this problem for a long time, not just for EF, but for WCF in general, because it’s the way that WCF serializes that causes the problem.

So the question is, did they just implement this specifically for EF, or will this have a broader impact? We’ll see when the next CTP (as per Danny’s comment, he says CTP not Beta4) of EF comes out.

  Sign up for my newsletter so you don't miss my conference & Pluralsight course announcements!  

5 thoughts on “Hallelujah – Entity Graphs will be XML serializable

  1. For what it’s worth, I used the term "CTP" just in the general sense of the next time we release something for customers to preview before the final release.Probably it will be a beta rather than a CTP.Also, we’re still on track to ship middle of this year–this doesn’t imply a delay in the ship schedule or anything like that.- Danny

  2. I wonder if this has any impact on the lack of ability to detach an entity and keep its children attached. Any word on this?

  3. Hi BrianThat’s actually different. What your seeing there is a rule about graphs, which is that they either need to be entirely in the cache or entirely out of the cache. So if you detach a particular object that is part of a graph, the context will break the graph apart to accommodate that rule. I believe that the only way really is going to be to detach them individually then reconstruct the graph in memory. It would be a great utility or method extension to cook up, wouldn’t it?

  4. Yeah, it seems it should be possible to do. I’m going to have to look into it, because I would really like the ability to detach an entire graph and do something like store it in a cache.How does serialization of a graph work across tiers though? Is the context serialized and sent along with the graph?The more I try to use the framework, the more I keep running into these pitfalls. I just found out tonight that I can’t store unsigned integers.

  5. BrianThese are topics that have had a lot of discussion in the forums and on blogs.:-)The short story: Binary Serializatoin will serialize the entire graph. In Beta3, XML serialization will not (this is an issue with xml serialization, not entities), but as this blog post indicates, that will change going forward. If you serialize rather than explicitly detach you will get these benefits. The objectcontext (nor the objectstatemanager or the objectStateEntities) are not seriliazable so state doesn’t go along for the ride. Again, tons of discussion in the forums and on my blog and in other blogs – I would especially head for Danny Simmon’s blog (blogs.msdn.com/dsimmons) and just search on EntityBag which is an experiment, not an upcoming EF implementation.The Resources page of the DataDeveloper site has links to a lot of people who are writing about and wroking with EF. Also, the DataDeveloper blog tries to highlight blog posts about EF and other data access. For highglights AND analysis – Roger Jennings blog also. He seems to find and list every thing out there. So you can peruse those sources rather than having to look all over kingdom come.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.