Forms4-Programming-Style

From: Michael Stowe <Michael.Stowe_at_f573.n115.z1.nwugate.fidonet.org>
Date: Sat, 01 Oct 94 11:38:37 -0500
Message-ID: <781015117_at_f573.n115.z1.ftn>


  • Quoting Juergen Degenhardt to All dated 09-29-94 ***
    > We are programming with Forms 4.0.12 for Windows since 3 weeks. But
    > while
    > i am totaly new with ORACLE some of my colleagues are programming with
    > Forms 3 for about a year - or so - in an UNIX character oriented
    > environment.
    > We have to write an application which will include about 20 masks. I
    > write "masks" for not to say forms, because there is the problem.
    > My colleagues want to write this application by creating 20 forms. My
    > point of view is to create only 1 (or 2) forms containing 20 canvases
    > and perhaps 10 to 15 windows. I think this architecture is appropriate to
    > the tool and the language PL/SQL.

There isn't enough information about the application here; it largely depends on what kind of user interface you wish to create, rather than any kind of technical concern.

However, I will offer a STRONG warning against the use of global variables, especially in Windows. Globals are problematic for many reasons, including that they create unmovable areas in Windows memory, which can effectively fragment Windows memory and cause crashing or other bad effects, in addition to just being poor practice.

> My colleagues said they have ever done so dividing the application in
> forms, because this makes it possible to work in parallel with many
> programmers.

This is a sensible argument, to a degree. I would expect that common modules would be defined first and built into libraries, reducing the amount of work that each programmer must do, and that a template has been built, allowing each programmer to create forms with the same look and feel.

> I say it's not so professional using only global variables for
> "communication" between forms modules in an application. You know,
> global variables have the type char and the fixed length of 200 bytes. Not
> very flexible! You have to do without the use of direct-referencing
> variables and items of objects lying in another form.

Not only is it unprofessional, it is a VERY bad idea. Apart from being very poor practice to begin with, even if they are used perfectly (and this is rare) they cause problems. Parameter lists are the appropriate vehicle for communicating between forms; if parameter lists are not adequate, then serious thought should be given to the design.

> And what's about the memory which is allocated by calling a form and
> still occupied returning from it. (Our measurements gives a 1.6 kByte
> bunch lost per called form. ORACLE hotline said, it will bee clean in
> 4.0.13)

It depends. The global memory allocated will always be an anchor in Windows memory. Normal calls (that is, using NO globals) should work fine. Received on Sat Oct 01 1994 - 17:38:37 CET

Original text of this message