Re: Demoting and Promoting Serialised Objects



On Tue, 5 Jul 2005 18:19:48 +0200, "Boudewijn Dijkstra"
<usenet@xxxxxxxxxxxxxxxxxxx> wrote or quoted :

>You cannot 'cast back to the original type', because it was lost in the
>conversion object.

Cached information in the object might be restored by accessing a
database to refresh it. Some might be recomputed. It is just a more
general problem of reconsituting transient fields.

In most cases an object has one of three life cycle patterns:

1. Starts out as a Dalmatian and gets stripped for export.

2. Starts out as a Dog. Later your find out the breed and want to add
that breed-specific information. You did not know it was going to be a
Dalmatian to start so all you could do is temporarily create a dog.
As you find out more information, you promote the object.

3. You compress fat objects by demoting them, stripping them of their
unused fields. If they ever need those fields again you promote them.
Think here of situation where you have millions of objects and every
byte counts in your Persistent Store.

Think in terms of converting a record from a married to unmarried
person and back.

You want the convenience of treating Married as a subclass of Person,
rather than as a separate Object of relevant-to-married fields.



--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
.