Re: [BLACKBOX] Storing an extended object

From: Douglas G. Danforth <"Douglas>
Date: Tue, 11 Nov 2008 15:52:45 -0800

----boundary-LibPST-iamunique-785888870_-_-
Content-type: text/plain

Robert, Josef, and Gerhard

Thank you all for your suggestions.
I will now mull over which is the best way.

-Doug Danforth


Robert wrote:
> Doug
>
> 1 -
> In your Base type declare a NEW EMPTY PROCEDURE Externalize2-.
> Call it in your Externalize PROCEDURE.
>
> In your extended type implement Externalize2 for the additional fields.
>
> If further extensions are possible, ectend the chain to Externalize3-
> etc.
>
>
> 2 - For extensive examples of this technique look at Escher, eg
> Escher.EdgeFigures.
>
> 3 - YES - DO store a version byte - it will get you out of trouble
> every time.
>
> Cheers
>
> Robert
>
>
> PS: Using 'Super' calls is 'Deprecated' "because of the so-called
> semantic fragile base class problem" - See the 'Whats New' Docu. I
> don't understand any of this, but just trust the computer scientists
> to have got it right!
>
>
> Douglas G. Danforth wrote:
>> I am not quite sure how to implement the Externalize and Internalize
>> procedures
>> for objects that are an extension of a base type. If I write an
>> Externalize procedure
>> (one for the base and one for the extension) then BB complains. So
>> must I do something
>> like the following?
>>
>> TYPE
>> Base = POINTER TO EXTENSIBLE RECORD(Stores.Store)
>> data: INTEGER
>> END;
>> Sub = POINTER TO RECORD(Base)
>> moreData: INTEGER;
>> END;
>>
>> PROCEDURE (base: Base) Externalize- (VAR wr: Stores.Writer);
>> BEGIN
>> wr.WriteInt(base.data);
>> WITH base: Sub DO
>> wr.WriteInt(base.moreData);
>> ELSE
>> END
>> END Externalize;
>>
>> But now when I internalize what must I do?
>>
>> This seems cumbersome and not very elegant.
>> -Doug Danforth

>>
>>
>> ----
>> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
>> LISTSERV{([at]})nowhere.xy
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> No virus found in this incoming message.
>> Checked by AVG - http://www.avg.com Version: 8.0.175 / Virus
>> Database: 270.9.1/1781 - Release Date: 11/11/2008 08:59
>>
>
>
> ----
> To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to
> LISTSERV{([at]})nowhere.xy
>
>


----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy----boundary-LibPST-iamunique-785888870_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFJvYmVydCwgSm9zZWYsIGFuZCBHZXJoYXJkXHBh
cg0KXHBhcg0KVGhhbmsgeW91IGFsbCBmb3IgeW91ciBzdWdnZXN0aW9ucy5ccGFyDQpJIHdpbGwg
bm93IG11bGwgb3ZlciB3aGljaCBpcyB0aGUgYmVzdCB3YXkuXHBhcg0KXHBhcg0KLURvdWcgRGFu
Zm9ydGhccGFyDQpccGFyDQpccGFyDQpSb2JlcnQgd3JvdGU6XHBhcg0KPiBEb3VnXHBhcg0KPlxw
YXINCj4gMSAtXHBhcg0KPiBJbiB5b3VyIEJhc2UgdHlwZSBkZWNsYXJlIGEgTkVXIEVNUFRZIFBS
T0NFRFVSRSBFeHRlcm5hbGl6ZTItLlxwYXINCj4gQ2FsbCBpdCBpbiB5b3VyIEV4dGVybmFsaXpl
IFBST0NFRFVSRS5ccGFyDQo+XHBhcg0KPiBJbiB5b3VyIGV4dGVuZGVkIHR5cGUgaW1wbGVtZW50
IEV4dGVybmFsaXplMiBmb3I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