home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / OOFILE / docs / gui.txt < prev    next >
Encoding:
Text File  |  1995-08-27  |  6.9 KB  |  150 lines  |  [TEXT/ttxt]

  1. GUI.TXT
  2.  
  3. This document describes the common philosophy to integrating OOFILE into application frameworks. This is a first pass at these classes, after spending a while looking for common elements in the PowerPlant, TCL, zApp, OWL and TurboVision frameworks. Please provide as much comment as possible.
  4.  
  5. The philosophy of GUI integration is based around making life easy for existing programs, as well as new ones. Inheritance is NOT used to add behaviour, so your class hierarchy doesn't change. Where behaviour can be standardized, a call to a "helper" class wraps our behaviour. eg: a dbDocHelper would be called in response to a command, possibly handling a standard Add command.
  6.  
  7. See "guicases.txt" which describes the typical events in a gui database application in terms of Use Cases.
  8.  
  9. See also "guihooks.txt" which describes the points 
  10.  
  11.  
  12. Class Responsibilities relating to database applications
  13. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  14.  
  15. Notes: 
  16. 1) Ownership implies creating/destroying an object
  17.  
  18. 2) Obey refers to some command travelling up the chain
  19.  
  20. 3) An Application may have a single document, representing a fixed database, or 
  21.    support the paradigm of multiple documents, with possible limit on how many 
  22.    can be opened concurrently.
  23.  
  24. 4) Document and ListWindow may be combined in frameworks lacking an explicit 
  25.    Document class (eg: with zApp)
  26.  
  27. Application
  28.     Owns Documents that manage different document types
  29.     Owns Application level alerts and dialogs, eg: About box
  30.     Obeys Display Application-level windows
  31.  
  32.  
  33. Document
  34.     Owns relevant data files/databases
  35.     Owns Browser windows
  36.     Owns Editor windows
  37.     Creates/Opens databases
  38.     Defines database, including runtime definition of Relationships
  39.     Obeys Edit/Delete/Create record 
  40.  
  41.  
  42. ListWindow
  43.     Owns browser panes
  44.     Knows structure of database classes shown
  45.     Receives a dbView to display
  46.     Obeys Sort listed records
  47.     Obeys Search to change list of records
  48.  
  49.  
  50. EditWindow
  51.     Owns editing panes, including embedded tables
  52.     Knows structure of database classes edited
  53.     Receives a dbTable subclass to edit
  54.     Obeys Save/Cancel current record
  55.     Obeys Move To Another record (first, prev, next etc.)
  56.  
  57.  
  58. OVERALL DESIGN
  59. The first approach to the gui classes will re-implement classes for each environment. This is because
  60. 1) it's easier to get started
  61.  
  62. 2) in some cases it won't be possible to inherit methods due to parameters (eg: window types) varying according to the framework we use.
  63.  
  64. 3) the GUI integration classes are designed to be a very lightweight set, working cleanly with the chosen framework.
  65.  
  66.  
  67. ABSTRACTIONS PROVIDED
  68. From the view of a typical database application, we can categorize:
  69.  
  70. Browsing
  71. - displaying lists of records, possibly 100,000's of records, too large for 
  72.   memory-based displays
  73. - commands (probably attached to buttons)
  74.   - navigate (First, Prev, Next, Last)
  75.   - change records (Add, Delete, Modify, View)
  76.   - search
  77.   - sort
  78. - philosophic difference between single record screens
  79.   - any time record is shown, change is allowed
  80.   - explicit Modify vs View commands
  81. - browser display may change when no records
  82.   - because file empty
  83.   - because selection empty
  84. - scrollable browser areas will often not occupy the entire window, but may have 
  85.   a button or descriptive area above or below. 
  86. - browsers have a header area that displays column titles and later will allow
  87.   mouse responses - click to sort, drag columns, drag dividers etc.
  88.  
  89. Editing
  90. - link edit fields to database
  91. - link embedded tables on screens to related files
  92. - handle multiple dialogs corresponding to several pages on same object
  93. - navigation buttons, with philosophic difference on moving to another record
  94.   - save is implied
  95.   - user alerted if changes made, and asked if want to save
  96.  
  97.  
  98. Note:
  99. A lot of the Browser behaviour would be expected to spill over into the GUI report-writer.
  100.  
  101.  
  102. DETAILED ISSUES and FRAMEWORK BEHAVIOUR NEEDED
  103. Scrolling Browsers
  104. Most frameworks have a mechanism for linking the scrolling of the window to a given feedback function or pane within the window.
  105.  
  106. A common need is non-scrolling areas adjacent to our dbBrowsePane. At this stage it seems like we can get away with leaving it to the framework. If this fails, we will have to abstract things with a nesting of:
  107. dbBrowseWrapper
  108.   someOtherPane
  109.   dbBrowsePane
  110.   someOtherPane
  111.  
  112. The scroller would in this nested case send scrolling messages to dbBrowseWrapper which would forward them to dbBrowsePane. This should only be necessary if we have a framework which insists on a single pane within its scrolling windows.
  113.  
  114.  
  115. EDIT HANDLING - INHERITANCE vs LINKING
  116. The first round of GUI integration classes was with zApp. This framework is more sophisticated than others with edit forms - it automates the process of storing data in the edit fields. By inheriting from the standard edit fields, and override StoreData(), we had a very simple way of updating the database.
  117.  
  118. However, this approach is not provided for us in other frameworks. It would be easier to move between frameworks if OOFILE worked very similarly in all cases.
  119.  
  120. Most importantly, if OOFILE links to edit fields by subclassing, this removes your freedom to subclass for your own reasons. 
  121.  
  122. For the above reasons, it was decided that the general philosophy should be that OOFILE communicates with edit fields via an intermediate dbFieldLink.
  123.  
  124. This abstraction gives us a lot of flexibility - a dbFieldLink subclass could communicate with a different source of data (eg: a comms link) to update a field.
  125.  
  126.  
  127.  
  128. MULTIPLE-PAGE EDITING
  129. This first gui release will probably not include support, but here's an outline.
  130. Issues:
  131. 1) the same fields often show up on subsequent pages, so editing in one page 
  132.    must flow through to the others.
  133.  
  134. 2) for speed reasons (and sometimes to limit memory leaks) we may hide dialogs 
  135.    rather than destroying them, as we move to the next page. This may occur only 
  136.    when moving between pages, or dialogs may persist (hidden) for the life of 
  137.    the program.
  138.  
  139.  
  140. BROWSER PANES
  141. The issue of column widths and horizontal scrolling is a complex one. Let's confine the panes to the case where the containing window has scrollbars and the contents of the pane scroll in reaction, similar to a WP document.
  142.  
  143. There are three choices for setting the width of the pane
  144. 1) a fixed width, based on an ideal document/window width
  145. 2) a fixed width, totalling all the specified column widths
  146. 3) a variable width with the window changing size
  147.  
  148. In 1) and 3) we have to decide how to divide space amongst columns. Given each column (field) has some ideal entry width, the intuitively appealing approach is simply proportionally dividing the browser width. This runs into problems when mixing text and numeric data. In many scenarios, it is more desirable to lock some columns at a fixed width and make the others proportional. For example, a date or serial number is of little use if only a portion of the column is visible. (In the case of dates, a more sophisticated future version might change the date display format to match changing width.)
  149.  
  150.