473,804 Members | 3,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

serialization inherited objects

Hi,

I have some questions that are a little difficult to explain, so I give it a
try...

I have an application (aSP.NET with VB.NET codebehind) and I would like to
store my data on disk because the users could continue later on there
project with the same data already filled in.
So I would use the soap-serialization to store the info (the nested objects,
collections, ...). I think this process will work very well, also the
deserialization . But now the problems. It's almost certain that my app will
change a little bit within a few months. Some extra propertys in the objects
and so on. But it seeems that this will give problems with the
deserialization . Because older projects - that doesn't have the new
properties - must also keep worrking (loading in the data). And now I have
tested this with an simple class that has 3 properties. Serialized an
object. Then changed the classdefinition to 4 propertys and I received and
error.

Now I would like some solution will the serialization keeps working. So I
thaught of inheritance.
The problem is, that in my app I would like to keep using my original name
for the objects. Say The class is "Person". In my app I have several
dim-statements "as Person". When I make an new object "Person1" that
inherits form "Person", I have to change my statements to. Also how does the
serialization works then. I have an older "person"-object, so I can't use
the deserialization of "Person1". When i load in the data I would have to
check by some way which kind of object was stored (is this possible), to
call even the correct deserialization method...

Hmm, not easy to explain the problem. What I would like to do: is it
possible to use older serialized data in an application after the definition
of the objects (nested objects) are changed. Can i simply desrialize the old
data? And can this be done with the same "method/procedure" as when i
deserialize data that is already in the correct (latest) version. And how to
solve the problem when the new version has to change again, to version 2...

I have seen some info about "versioning " and serialization, but It isn't
very clear to me right know. Maybe someone that has some clear
examples/info. Maybe something like my problem.

Hopefully somebody can help me with this 'little' problem

Thx very muh

Frederik
Nov 20 '05 #1
0 1254

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1644
by: womber | last post by:
I am getting XML from a dataset that has been populated via a storedprocedure no schemas have been applied nor any relationships. But the correct table names have been given to match the table(s) equivalent business object(s). I have a custom collection that implements ICollection and IEnumerable. Here is the collection: Imports ERP.BusinessObjects Imports ERP.BusinessObjects.Helpdesk Imports ICTObjects.Collections
0
423
by: ron | last post by:
This is as clean as i can get it. Thanks Ron This is the base class that serializes and desrializes the class objects it also provides abstract methodes that are called from its inherited classes. namespace FDS.DataCollectionServer.DataProcessing
3
3179
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. It seems that either I can use default serialization or implement ISerializable. Is there any way to do both (e.g. extend the default serialization). In other words, I want to be able to implement my custom serialization code but call the...
1
1905
by: Glenn Wilson | last post by:
In the current project that I am planning i am thinking of serializing the objects to save as binary files. The question I have is with inheriting classes. If I have 1 base class and 2 classes that inherit from it. How would I configure them for serialization. Do I just put the Serialized setting on the 2 classes or do I also have to put it on the base class. ie.
2
5079
by: tony lock | last post by:
I have a class inherited from Control, which I want to serialize, since Control is not Serializable, I have had to implement ISerializable. This works but I now want to inherit this base class into a number of other classes, I was assuming that I could just mark them as and use automatic serialization but this does not work (The new class cannot deserialize, because it does not have the correct constructor ie one with arguments...
2
2593
by: Maximus | last post by:
Hi Everyone, I was using Inprocess session objects, but incase of aspnet process crashes the session objects were lost as a result I decided to shift to out of porocess session objects. For this i had to serialize the objects. While doing that I made the classes serializable whose objects I store in sessions. However, when I run the application I get the following error.
10
1491
by: SStory | last post by:
My app is near completed for the basic feature of version 1.0. I have an extensive object model and I now want to persist my objects using serialization. I have chosen binaryformatter to serialize, and custom serialization, which I understand will allow me the flexibility of not breaking old things when I add members to classes in the future and send to existing customers. 1.) is there anything else to consider with the custom...
4
11418
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I look at innerException it says: "Cannot serialize member 'System.ComponentModel.Component.Site' of type 'System.ComponentModel.ISite'. OK it is problem to serialize all data so I'll implement my Serialization. I implemented ISerializable...
0
4715
by: JosAH | last post by:
Introduction Upon hearing the word, "Serialization", the first question which comes to mind is ... "What is Serialization?" We know that we can create resusable objects in Java. But the lifetime of those objects lasts only as long as the Java virtual machine is running. Once we close the JVM, we lose all those objects. What if someone wants objects to be available after JVM restarts? This is where Serialization comes into play. ...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10338
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7622
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.