Saving graphs as Code Dom, part 2

time to read 1 min | 129 words


I posted a few days ago about Saving object graphs to file: CodeGen and Executable GraphsI just wrote the final test that made it all happen! I got objects that knows how to persist their state to code, and then load themselves right back from this code.
This is the first time I worked in Code Dom, and it was very easy to get it to work very quickly.

This is a huge security hole, of course, but I'll probably just play with the AppDomain permissions so the only thing it will be able to do is to give me the complete object graph. I got to say, there is quite a bit of satisfaction in saving files in this format. Very readable.