Re: Storing Dialogs to a file

From: [at]} <Wojtek>
Date: Thu, 26 Jun 2003 23:31:09 -0400 (EDT)

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

Gerard and Robert:

 I want to say I am impressed with the Wrapper that Gerard has sent
to the list. I would have never guessed such things are possible.
I am not a computer scientist and this level of trickery is
entirely above me. Anyway, I am still in the dark concerning
how to store Dialogs to disk. Dan who works with me on this project
has defined a "wrapper" type like this

  TYPE
    MyTree* = POINTER TO RECORD (Stores.Store)
         tree*:Dialog.Tree
    END;

But now what? He still needs to write the entire Internalize/
Externalize, which means traversing the tree and storing the
whole structure to disk. Basically, he needs to build an entire
"shadow tree" in memory, whose only purpose is that it can
be written to disk. The reverse needs to be done when reading
back. This looks like a lot of busy work to me.

Gerard has made a neat example, but his Wrapper wraps a View
which is persistent, and thus it will know how to write itself
to disk. But Dialog is NOT persistent, and hence it will not
store itself. Now we have to recreate the tree by hand when
writing/reading, just for the purpose of writing it to disk.

The point is made even more glaring by Robert saying he "extended"
the FormModel by adding his own pointer, what was possible
because the Form *source* is available. This is not the kind
of extension we were taught by Ominc, are we? But when
even such an expert like Robert has to resort to the source,
then I am even more thrown off into the dark.

Am I missing something obvious here? Is there an smart trick
to write a dialog to disk, or do we have to do everything

by hand from scratch, without even resorting to Robert's
method because this time no source is available?

Thank you,

Wojtek Skulski skulski{([at]})nowhere.xy

> > Wojtek Skulski skulski{([at]})nowhere.xy
>
> > In particular, we are not sure how we can implement
> > Internalize/Externalize for objects which are not
> > persistent.
> >

>Robert wrote:
>

> I have some 'Calculator' Forms which I wanted to save complete
> with the numbers in the Field Controls. Since the source of the
> Form SubSystem is public I extended FormModels.Model to include
> a variable myPtr* : Stores.Store. By assigning the 'Calculator'
> data to myPtr its Externalize (etc) routine is called when the form

> is Saved/Copied.
>
> I use FormModels.SetDir to enable my forms, which are then provided
> by the usual Menu item Controls->New Form.

> Gerard Meunier wrote:

> I have another solution, using wrappers. You can find examples in Obx, Pac,

> Plot, TabMult, etc... It's the way Wirth made complex objects in Oberon, and
> it works too in BB. It uses object composition instead of inheritance
> (Szyperski 1999, Component Software) and works even if the source code is
> unavailable.


--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-868401393_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIEdlcmFyZCBhbmQgUm9iZXJ0OlxwYXINClxwYXIN
CiBJIHdhbnQgdG8gc2F5IEkgYW0gaW1wcmVzc2VkIHdpdGggdGhlIFdyYXBwZXIgdGhhdCBHZXJh
cmQgaGFzIHNlbnRccGFyDQp0byB0aGUgbGlzdC4gSSB3b3VsZCBoYXZlIG5ldmVyIGd1ZXNzZWQg
c3VjaCB0aGluZ3MgYXJlIHBvc3NpYmxlLlxwYXINCkkgYW0gbm90IGEgY29tcHV0Z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N9fQACMASRBw==


----boundary-LibPST-iamunique-868401393_-_---
Received on Fri Jun 27 2003 - 05:31:09 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:29:10 UTC