Ultra Light Client Guide and Reference

Working with Data Models

Introduction

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.

Pre R3.0 Releases

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:

  1. The same list of employees is shown in one list sorted by names, in another sorted by domicile.
  2. Employees of an organisation need to be displayed in a tree showing the hierarchy of the organisation, but also in alphabetical order
  3. Subsets of a given set of application objects need to be displayed in various widgets, or changing subsets of the same data in the same widget.

ULC Release 3.0

UlcDataModel / ULCLocalTableModel

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

ItemLists define the structure of the data provided by its model. There are two groups of itemLists:

IndexedItemList
Provides a mapping of the model's data into an ordered collection. This collection is based on sort criteria in the case of the SortedItemList. Developers may implement their own subclasses to implement for example creation of subsets based on various criteria.
Note:A TableModel may serve any number of indexed itemLists.

HierarchicalItemList
Defines the parent-child relationships of the hierarchy's nodes, the hierarchy's root, and implements the accessing of children / parent of a given node. The ULC class UlcTreeItemList uses a HierarchyAdapter for this, making the itemlist more reusable. Application developers will either code their own adapter class, or configure instances of the UlcHierarchyAdapter class included in the release.

RowAdapters

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.

Summary

Index-based widgets (List, Table, ComboBox)

Hierarchical widgets (Tree, TreeTable)


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]