Form Based Design

FormBasedDesign is a way of building forms without explicitly writing code, used by VisualBasic and DelphiLanguage and many other RapidApplicationDevelopment tools.

An example of how you use it:

  1. Click on any component in your ComponentPalette?, such as a Button or any other Widget.

  2. Click on your empty form. (This step declares the component class. Instantiating the form will instantiate the component.)

  3. Your empty form now has a button on it. Move and size it with your mouse. (This step sets the left, top, height, and width of the button on the form.)

  4. Click on button properties.

  5. Set button Title to 'Ok'

  6. Select button OnClicked property, double click it. (This step creates an EventHandler, and makes a connection from the component to the event handler.)

  7. Type 'Self.Close' into the event handler.

You have now built a form, with its event handler code, with only one (or a few) lines of code.


Discussion:

In VisualBasic, the information created in this example is stored in the form's .frm file. This file is a text file, with a tidy, indented, hierarchical structure, followed by the event handler code. A programmer can easily edit this information either in the IDE, or in a text editor.


Long Term Effects

The event handler is on the Form class itself, not on another object that can be instantiated and tested independently of the GUI objects. Over time (and because FormBasedDesign is marketed at and for inexperienced developers) the application logic collects in the form classes and becomes increasingly tangled with UI concerns. The Form classes are not properly tested, because it is hard to test hand-written code without pushing messages through the event queue.

Eventually the project dies under it's own weight and is rewritten... starting by dragging buttons onto an empty form.


Buddhists should watch that they don't become too attached to forms.


EditText of this page (last edited December 30, 2007) or FindPage with title or text search