Organising Collections of Objects

An important consequence of a persistent system is that it must be possible easily and efficiently to organise and manage persistent files which contain collections of objects (e.g. a file of bank accounts). The Timor Collection Library [5] is organised at the type level as an inheritance hierarchy which is based on two criteria: a duplication criterion and an ordering criterion. This produces nine concrete types:

The concrete collection types

In addition five abstract types (shaded in Figure 4) are used to enhance polymorphism.

Structure of the TCL Collection Types

The objects in such collections can be defined generically as method parameters of these types. Hence it is possible to create, say, a Bag of Bank Accounts, a List of Integers, an Ordered Set of Car Registrations, a Set of Stacks, a Table of Persons, etc. If declared as persistent files, such types can correspond to any file types which appear in a conventional file system.

The second important point is that implementations are not implied in such type definitions. Because a Timor type can have multiple implementations, typical implementations found in conventional file systems (e.g. sequential, indexed sequential, random access, etc.) can be supported, and the code of these can be easily be built up from other implementations using re-use variables.

The organisation of collections is extensively discussed in [7].