[Oberon] Oberon for a C++ user.

Bob Walkden bob at web-options.com
Tue Nov 8 12:33:30 CET 2016


>> On 8 Nov 2016, at 02:46, Lars <noreply at z505.com> wrote:
>> 
>> On Sat, November 5, 2016 3:13 pm, Douglas G Danforth wrote:
>> Lars,
>> A BlackBox button activates a procedure in a module.  That procedure has
>> access to all of the resources of the module (variables and other
>> procedures). In a BlackBox form some of those variables can be accessed
>> and made visible in the form (if they have been exported, marked with
>> "*").  The form can
>> change the values of those variables before the button is pushed. That is
>> how communication takes place between the form and the procedure to which
>> the button is linked. -Doug Danforth
> 
> Any idea why they did not choose to use the delphi style system, where
> information is passed in through a parameter to the procedure?

Communication is 2-way between the controls and the model.

> 
> I am interested in the design decisions and why they were chosen.
> 
> I very much like having a parameter to inspect such as delphi's "sender"
> which is passed in.
> 
> When you mention exporting with a * it sounds as though these are global
> variables rather than local parameters passed in to a procedure.

That's correct.

> 
> I have to work with ComponentPascal and blackbox more, to understand it,
> but would be interesting to know the design decisions why they did not
> copy Delphi's system where information is often passed in as a procedure
> parameter which can be inspected and dealt with without resorting to
> globals.

It comes from academia, where the brief is not to copy but to innovate and improve.

It encourages layering in the module structure. The interface is based on mvc and described in the BB documentation. 

My practice has been to develop the model components with a dialog module separating them from the UI controls. This means you can have multiple independent UIs without cluttering the model, and conversely have multiple implementations of the model without affecting the UIs. The exported variables are in the dialog layer and the bound procedures in that layer execute the appropriate model actions.

Hope that makes sense.

B


More information about the Oberon mailing list