- Dialog: Copying data in order to display it

From: [at]} <skulski{>
Date: Wed, 25 May 2005 13:11:00 -0400 (EDT)

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

Doug:

It is more than you wrote. Dialog works with statically defined records,
while OOP design paradigm works best with dynamically allocated records.
The usual OOP paradigm is to define an Abstract Data Structure as a
POINTER TO RECORD, and then to instantiate such structures dynamically.
One can then make arrays of structures, linked lists of structures,
and so forth. Unless I am missing something obviuous, Dialog does not
display such dynamical structures. Nor does it display stack objects,
that is structures declared locally in a procedure. Dialog only works
with "interactors", that is statically declared records at a module
global level.

In my own DAQ programs I copy the data from my "objects" (i.e., dynamically
created structures) to interactors, and then I call Dialog.Update. In my
GUI commands I do the opposite: at the end of every command I copy the
relevant data back from the interactor to the object. The premise being
that the user has modified the interactor data, and then pressed a button
that the command is attached to.

I do not see a simple workaround, but I also do not see a pressing need
for such a workaround. It takes some getting used to, and it works
well. I am not sure I understand why we should not just get used to the
fact that this is the way Dialog works.

W.


> Folks,
> The module Dialog exports the following update functions
>
> PROCEDURE Update (IN interactor: ANYREC);
> PROCEDURE UpdateList (IN interactor: ANYREC);
> PROCEDURE UpdateBool (VAR b: BOOLEAN);
> PROCEDURE UpdateInt (VAR i: INTEGER);
> PROCEDURE UpdateLInt (VAR l: LONGINT);
> PROCEDURE UpdateReal (VAR r: REAL);
>
> There are no Updates for
>
> 2. SHORTCHAR the characters of the LatinĀ‘1 character set (0X .. 0FFX)
> 3. CHAR the characters of the Unicode character set (0X .. 0FFFFX)
> 4. BYTE the integers between MIN(BYTE) and MAX(BYTE)
> 5. SHORTINT the integers between MIN(SHORTINT) and MAX(SHORTINT)
> 8. SHORTREAL the real numbers between MIN(SHORTREAL) and MAX(SHORTREAL),
> the value INF
> 10.SET the sets of integers between 0 and MAX(SET)
>
> This seems(?) to necessitate 'copying' those data types to a record,
> rec, and then calling Update(rec). That is inefficient and violates
> the following principle.
>
> GUI PRINCIPLE
> Any module M should be displayable in a form F via a module D without
> copying any fields of M into D.
>
> Can this principle be realized in BlackBox? If not why not?
>
> If one must copy then F must reference both M and D which seems unclean
> (or all displayed exports of M must be copied to D and then only D is
> referenced in F).
>
> It copying can be avoided then F can reference the M data directly and
> only the guards and notifiers need reside in D. This would provide a
> clean separation of disciplines.
>
> -Doug Danforth
>
> --- BlackBox
> --- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy
>
>

--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy



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

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzc1xmY2hhcnNldDAgQXJpYWw7fQ0Ke1xmMVxmbW9kZXJuIENvdXJpZXIgTmV3O30NCntcZjJc
Zm5pbFxmY2hhcnNldDIgU3ltYm9sO30NCntcZjNcZm1vZGVyblxmY2hhcnNldDAgQ291cmllciBO
ZXc7fX0NCntcY29sb3J0YmxccmVkMFxncmVlbjBcYmx1ZTA7XHJlZDBcZ3JlZW4wXGJsdWUyNTU7
fQ0KXHVjMVxwYXJkXHBsYWluXGRlZnRhYjM2MCBcZjBcZnMyMCBEb3VnOlxwYXINClxwYXINCkl0
IGlzIG1vcmUgdGhhbiB5b3Ugd3JvdGUuIERpYWxvZyB3b3JrcyB3aXRoIHN0YXRpY2FsbHkgZGVm
aW5lZCByZWNvcmRzLFxwYXINCndoaWxlIE9PUCBkZXNpZ24gcGFyYWRpZ20gd29ya3MgYmVzdCB3
aXRoIGR5bmFtaWNhbGx5IGFsbG9jYXRlZCByZWNvcmRzLlxwYXINClRoZSB1c3VhbCBPT1AgcGFy
YWRpZ20gaXMgdG8gZGVmaW5lIGFuIEFic3RyYWN0IERhdGEgU3RydWN0dXJlIGFzIGFccGFyDQpQ
T0lOVEVSIFRPIFJFQ09SRCwgYW5kIHR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ed May 25 2005 - 19:11:00 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:14 UTC