Browse Prior Art Database

Managing Runtime Dialog Template Libraries for Maximum Efficiencies

IP.com Disclosure Number: IPCOM000111604D
Original Publication Date: 1994-Mar-01
Included in the Prior Art Database: 2005-Mar-26
Document File: 2 page(s) / 95K

Publishing Venue

IBM

Related People

Morgan, SA: AUTHOR [+4]

Abstract

Dialogs in an OS/2* Presentation Manager* (PM) environment can be predefined in a DLG file, compiled and stored in a DLL, or they can be created dynamically at runtime. Reading a predefined template in from a DLL is the usual manner in which dialogs are created. This technique does not, however, allow for the many changes to the dialogs so often dictated by the current runtime environment.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Managing Runtime Dialog Template Libraries for Maximum Efficiencies

      Dialogs in an OS/2* Presentation Manager* (PM) environment can
be predefined in a DLG file, compiled and stored in a DLL, or they
can be created dynamically at runtime.  Reading a predefined template
in from a DLL is the usual manner in which dialogs are created.  This
technique does not, however, allow for the many changes to the
dialogs so often dictated by the current runtime environment.

      Creating a dialog template at runtime can be very advantageous
for the application.  This is done by reading in a binary description
of the dialog and then creating a dialog template in memory that
contains all of the information needed for the dialog's creation by
PM.  While this dynamic technique gives the application great
flexibility as regards the dialog's layout, text used, size of
controls and general appearance, it does involve some performance
trade-offs.

      The solution to the trade-offs is intelligent creation and
maintenance of a runtime dialog template library.  Once the template
has been created for the initial appearance of the dialog, it can be
stored in the dialog library.  The next time the panel is to be
displayed, the template can be read from the library rather than
recreated.  This results in a performance improvement over both
dynamic creation and reading it in from a DLL.

      The templates take up memory, however, so there needs to be
intelligent maintenance of the template library.  Since some dialogs
may be shown very infrequently, there will be little performance gain
from keeping their templates in the library.  The application should
therefore be able to set a flag that indicates whether a particular
dialog should or should not be stored in the library.  For those
dialogs that are not reasonably expected to be shown again any time
soon, the flag should be set to not store their templates, thus
reducing memory usage.

      As the number of templates in the library increases, search
time also becomes a consideration.  While small libraries might use a
linear search, medium-sized libraries should consider a hash table,
and large libraries should use a binary tree.

      As more dialogs are displayed and are stored in the library,
the overall size of the library needs to be contained.  Since the
library should only contain those templates for dialogs likely to be
redisplayed, a time and use count should be kept with each library
entry.  The time the dialog wa...