ULC has always strived to minimize traffic between the client and the server. For data this means that only data is loaded into the UI that is actually needed. The UI caches all data until it is invalidated from the server. Prior to Release 3.0 ULC has concerned itself mainly with minimizing the traffic related to data contents. Release 3.0 goes one step further and addresses traffic related to presentation.
Table- and TreeModel were designed to work closely with their widget. They encapsulate both the local ULC cache of application provided data and their structure on the UI. The model defines the order in which the rows are displayed, or the parent-child relationship in the tree's case.
Accessing instance variables of the models' objects is implemented by the model classes. To handle special cases new subclasses had to be created. If data of a given model needs to be displayed in different ways this implementation is too limiting. Example:
Release 3.0 introduces a new model that can serve both hierarchical and indexed itemLists. In Smalltalk this class is called UlcDataModel.
Any presentation instructions (such as ordering of rows, parent-child relationships, root objects for trees etc) must be defined in the itemlists served by an instance of a dataModel. It is possible to directly connect a dataModel to an index-based widget, in which case it works like a TableModel.
ItemLists define the structure of the data provided by its model. There are two groups of itemLists:
Note: | A TableModel may serve any number of indexed itemLists. |
The object instance variable access implementations of both UlcTableModel and UlcTreeModel have not changed. They answer themselves as their rowAdapters. Subclasses of these classes may override this, however, and answer a specific rowAdapter. Such adapters may be implemented easily as subclasses of UlcRowAdapter if the application objects do not conform to their platform's instance variable accessing conventions. If they do conform, ULC includes a default rowAdapter that can be used for all application objects. NOTE that UlcDataModel always uses a rowAdapter.
Index-based widgets (List, Table, ComboBox)
Hierarchical widgets (Tree, TreeTable)