6 3 You Use a Repository Based Graphical Designer

Visual LANSA

6.3 You Use a Repository-Based Graphical Designer

Unlike most other GUI tools, Visual LANSA implements a repository-based approach. As always, the LANSA repository centralizes the common business information about your applications.

This means that you get all the benefits characteristic of LANSA application development in addition to GUI capabilities:

  • A short learning curve
  • Productivity
  • Reuse
  • Simplicity
  • Ease-of maintenance
  • Consistency
  • Multilingual support

A repository approach is essential when developing GUI applications. This is because in this environment applications are quick to develop and as a consequence their number can grow rapidly. Without a repository approach you will easily end up in a situation where you have lots of applications with a lot of duplicated code. This means that the time you have gained in developing the applications is quickly spent maintaining them. The repository gives you the means to control the development process by ensuring consistency and reuse and by making the maintenance of applications quick and simple.

Also, it is quite possible that your applications may lack a common look and feel, no matter how strict interface standards you have created, because GUI development gives you so much freedom. Here again the repository helps you to stay in control by imposing uniformity of visual representation.

You Define Data in the Repository Once

As an example, let's look at how you would handle an employee number field in a typical GUI application and in LANSA.

In a typical GUI tool (such as Visual Basic):

  • You present the employee number as a text field with a separate label.

  • You have to create a new text field and a new label for every application and every window where employee number is used.

    It's likely that the text, the character case, the font, the size and maybe even the colors of the labels are slightly different in every application, especially if more than one developer is involved. Some developers might add spin buttons to the edit box so that the user can scroll employee numbers. Others might use a combo box instead of a text box.
  • You have to size the text field to fit the employee number every time it is used. To find out the required size, you have to execute the application to fetch data from the database to see if it fits.
  • To retrieve or insert the employee number in the application, you have to explicitly associate the text field with a record in the database.
  • You have to code the validation logic for employee number separately in every application.
  • You have to code error handling for employee number separately in every application.
  • In a localized version you have to substitute the translated text of the label in a separate resource file for every occurrence of the label.

Whereas in Visual LANSA:

  • You store the employee number in the repository as a field with a description (label), validation rules, error handling and help text. You can enter the label in multiple languages. Of course you do this only once.
  • When developing an application, you drag the employee number field to any window where this information is required. This is all you need to do.

   Note that:

  • The field is displayed with a label and it is sized to fit the field in the database automatically.
  • When you change the label in the field definition, this change will be reflected in every application where the field is used.
  • You do not have to write any validation rules or error handling because they have been defined in the repository.
  • The field is implicitly bound to the field in the database. When you execute the application, you can specify in which language the labels are shown.

Think about how you maintain applications in these different environments. For example, what would you need to do if the length of the employee number is changed?

 

Intelligent Lists, Grids and Graphs Are Based on the Repository

The power of the advanced list, tree view, grid and graph components in Visual LANSA is also based on the repository. You define the data to be shown in these components simply by dragging fields to them. For instance you create a list of employee numbers by dragging the employee number field to a list component.

Visual Styles

The appearance of Visual LANSA components is controlled by visual style components. A visual style component controls the appearance of the application including colors, fonts and 3D effects.

You can set one visual style to govern your entire application. This ensures absolute uniformity and makes it possible to make global changes by changing a single setting. Visual styles are multilingual so that you can define different settings for different languages in one style.

Ý 6. Creating Applications Using Components