|
-
Jun 26th, 2006, 11:43 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] (2005) Serialization, interfaces, and unavailable classes
I have a fairly complex class structure and I want to serialize some of it to a file. Some of the classes to be serialized are loaded at runtime from external plugins (all of them implement my IDocumentContent interface). What I want to know is: if I serialize a IDocumentContent plugin that has members that are not from the IDocumentContent interface (i.e. plugin specific settings, etc.) are those serialized as well?
The second question is this: Can the data is deserialized onto a machine with IDocumentContent interface, but not the plugin that created it (with its own data)?
Last question, if so, if the data is again re-serialized, will the plugin specific data remain so that it can be deserialized onto the original machine with the plugin?
Unfortunatly, I'm not at a stage where I can test this. I need to design around the answers to this. Should the IDocumentContent inferface include a PluginSpecificData property of type ISerializable?
-
Jun 26th, 2006, 11:47 PM
#2
Re: (2005) Serialization, interfaces, and unavailable classes
You know what? You are at the stage where you can test this. You simply create a couple of new projects, an interface with a one member and a class that implements that interface with an additional member. I know what I think the answers to your questions are but I don't know for a fact, so that's how I would find out for myself. It would take about 30 minutes.
-
Jun 29th, 2006, 02:10 AM
#3
Thread Starter
Fanatic Member
Re: (2005) Serialization, interfaces, and unavailable classes
OK... after numerous tests, serializing something derived from interface IDocumentContent that has extra members ALWAYS causes those extra members to be serialized. (It was what I needed...)
Second question is No. The plugin must exist for the data to be deserialized at all.
Third question is moot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|