[plt-scheme] GUI Development Approach

From: Hans Oesterholt-Dijkema (hdnews at gawab.com)
Date: Wed Nov 23 07:26:26 EST 2005

At my work I've made meta objects about data (we're programming perl
there). This has made it possible to generate a UI for both ASCII, HTML \
and GUI on basis of the same meta objects with some added parameters

My meta objects contain access to the data layer, and have the
following properties.

- getter
- setter
- label
- help
- type
- primary unit
- accepted units
- input validator
- value validator/corrector
- [there's another one, which I forgot about now]

all properties contain (anonymous) functions that get called.

These meta objects are a layer between gui and data. The GUI
can display the data without the need to know about data structures, etc.

The meta objects "speak" perl data types, the getter/setters transform
this to the datalayer. The input validator reads strings that it can 
validate
for the input (e.g. restricting input while typeing) The validator gets
the type that has been specified to validate in the primary unit.

The setter converts from perl type to the data layer the getter converts
from the datalayer to perl type.

--
Hans


Paulo Jorge Matos schreef:

>Hi,
>
>Thanks for the references, however, I think that the problem is not about MVC.
>The issue is that I'm trying to create independent classes for a set
>of widgets. And these widgets sooner or later require one another.
>Probably I should not try to make them so independent. If nobody
>suggests better I'll be merging every cycle into one object to
>eliminate cyclic dependencies.
>
>Here's my situation.
>I developed a low-level set of functions to handle database access,
>data transformation and filtering, etc. Now I have a set of objects
>which generate the GUI and call these low-level functions. I have a
>Main object, a Menu object, a List Object and an Info Object.
>The Main object creates the main frame and calls menu object which
>gets passed the main frame, creates menus and attaches itself to the
>frame. Then from Menu I create a pane in the frame and generate two
>other objects List and Info. The List object generates a list and the
>info object creates some labels, a readonly list and a button.
>However, I initially managed to create the Info obj first and send
>List to the Info object as an init-field. However now, I see that List
>and Info require each other.  Probably I'll merge Info and List into
>one. But still, while we're on the subject are there any ideas,
>comments and suggestions to this 'object-oriented' user interface
>separation 'schema'?
>
>How do you usually work out your UIs?
>
>Cheers,
>
>Paulo Matos
>
>On 23/11/05, Corey Sweeney <corey.sweeney at gmail.com> wrote:
>  
>
>>You may wish to investigate "Model-view-controller"
>>http://en.wikipedia.org/wiki/Model-view-controller.  It
>>sounds like this is probably what you don't want, but it's a known name, and
>>you can use it as a keyword to run searchs for alternatives to
>>model-view-controller.
>>
>> Also, note that the Drscheme GUI builder allows the builders GUI
>>representations to be inline, so you can put pieces anywhere you want.
>>
>> I talk about guibuiler here:
>>http://students.depaul.edu/~csweeney/Guibuilder.Tutorial.html
>>
>> Corey
>>
>>
>>
>>On 11/22/05, Paulo Jorge Matos <pocmatos at gmail.com> wrote:
>>    
>>
>>>Hi all,
>>>
>>>I'm not used to development of GUI applications but from what I've
>>>seen from GTK apps (generated usually by Glade) and MrEd apps, code
>>>gets a mess rapidly since all widgets get stuck into the same file
>>>when created due to the fact that they interact with one another. A
>>>button click updates a list box. The list box updates some fields. The
>>>menu bar... etc, etc, etc...
>>>
>>>Is there a structured approach to writing a GUI without having to
>>>define all widgets in a module.
>>>I tried to define each GUI part as an object. Initially I had a
>>>dependency graph and I made sure all widgets which generated a
>>>dependency cycle (changed each other) were within the same module. And
>>>the initial implementation started ok. With the need to add features,
>>>I started to need to change this button and that label and that...
>>>that were in diferent models. Now I'm stuck in the middle of cyclic
>>>module dependencies... :-|
>>>
>>>Any hints, tips, or reference papers would be _greatly_ appreciated.
>>>
>>>Cheers,
>>>--
>>>Paulo Jorge Matos - pocm at sat inesc-id pt
>>>Web: http://sat.inesc-id.pt/~pocm
>>>Computer and Software Engineering
>>>INESC-ID - SAT Group
>>>_________________________________________________
>>>  For list-related administrative tasks:
>>>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>>
>>>      
>>>
>>
>>--
>>((lambda (y) (y y)) (lambda (y) (y y)))
>>    
>>
>
>
>--
>Paulo Jorge Matos - pocm at sat inesc-id pt
>Web: http://sat.inesc-id.pt/~pocm
>Computer and Software Engineering
>INESC-ID - SAT Group
>_________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>  
>



Posted on the users mailing list.