[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Serializing with version schemas

Posted on 2002-03-12
6
Medium Priority
?
244 Views
Last Modified: 2013-11-20
I have a simple question about serializing objects.
following scenario:

having three classes A, B, C
C is derived from B which is derived from A; A itself is derived from CObject:

CObject
|
A
|
B
|
C

Each class has its own Serialize() function. Each class is responsible
for storing/loading its specific member variables.
To store/load the additional variables of the base calss(es), it first
calls Serialize() from the base class.

Now my question:
Is it possible to use versionable schemas here ?
I've tried it and my problem is that only the function in the
"first Serialize()-level" gets the schema number.
All other functions get "-1" for archive number.

I can't believe that the Microsofties didn't take this into their
design goals since this this object oriented programming at a very
basic level ...

I appreciate your comments.
0
Comment
Question by:Pacman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 2

Expert Comment

by:christophm
ID: 6857271
Hi Pacman,
The 'version' (when serializing classes / persisting data) is the 'version_of_the_Archive' and is not used as a version level/indicator for different types of objects stored in the archive. I once looked up exactly what goes in a 'document' in the uSoft document/view paradigm and the/a version is stored only once (though the archive may contain objects of many different classes).
good luck - christophm
0
 
LVL 9

Author Comment

by:Pacman
ID: 6859761
The version of the archive ? I never heard of that.
You can write different objects with different schema numbers in one archive. Each object has its own schema number.
0
 
LVL 2

Expert Comment

by:christophm
ID: 6861335
Hi Pacman, - You are correct, I typed without thinking, the version number is part of the object not the Archive.

I just looked in all my reference stuff - I didn't find a black and white answer.  Blaszczak's book (V5) says the version "identifies the version of the object that created the serialized information".  Since "A" and "B" were not serialized (the descendant "C" was) then the serialized object has only the version number of "C".  Also mentioned was that a -1 version (a UINT) was reserved for MFC.  

I agree, it doesn't seem to fit the "OO" plan.  
Sorry to have mispoke - chris-m
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Author Comment

by:Pacman
ID: 6863717
Hi chris,

thank you for your comments.

>> Also mentioned was that a -1 version (a UINT) was reserved for MFC.

Yes, that's if you call GetObjectSchema() twice.
The first time you get the correct schema number.
From then on you always get -1.

Guess I've to store my own schema number.
Pacman
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 10401817
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
PAQ - refund points
Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

AndyAinscow
EE Cleanup Volunteer

0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 10434973
PAQed, with points refunded (50)

modulo
Community Support Moderator
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question