Object Persistence

Object Persistence: A Framework Based on Design Patterns

Authors: Jörg Kienzle and Alexander Romanovsky

[1] describes a framework for providing object persistence in object-oriented programming languages without modifying the run-time system or the language itself. The framework does not rely on any kind of special programming language features. It only uses basic object-oriented programming techniques, and is therefore implementable in any object-oriented programming language. The poster [3] gives an overview of the structure of the framework.

The framework clearly separates persistence control from storage control. The kind of storage to be used for saving application data depends heavily on the application requirements. Properties such as performance, capacity of the storage media and particularities of usage may affect the choice. This is why a hierarchy of different storage classes, useful in different application domains, is introduced. The hierarchy is split into volatile storage and non-volatile storage . Data stored on non-volatile storage remains on the storage device even when a program terminates. Among the different non-volatile storage devices, we distinguish stable and non-stable devices. Data written to non-stable storage may get corrupted, if the system fails for instance by crashing during the write operation. Stable storage ensures that under certain assumptions stored data will never be corrupted, even in the presence of application crashes and other failures.

The framework is to be used by two different types of programmers: persistence support programmers and application programmers .

Persistence support programmers will add support for new storage devices to the framework by extending the storage class hierarchy. Application programmers will use the framework to declare persistent objects. When instantiating a new persistent object, the application programmer specifies where the state of the object will be saved by choosing among the existing implementation of storage devices. The operations defined for persistent objects allow the application programmer to save or restore the state of the object at any time.

The structure of the framework is based on well-known design patterns ( Strategy , Factory Method and Serializer ). The advantages of using design patterns and object-orientation in this context are substantial. In particular, they allowed us to achieve the following important goals:

  • Clear separation of concerns: The persistent object does not know about storage devices or about the data format that is used when writing the state of the object onto the storage device and vice versa.
  • Modularity and extensibility: It is straightforward to define new persistent objects or add support for new storage devices.
  • Safe and flexible storage management: Storage leaks leading to wasted space on the storage device have been prevented. Switching storage devices is straightforward.

An implementation using the object-oriented programming language Ada 95 has been realized [2]. The following storages have been implemented: main memory storage, file storage, remote storage, mirrored storage and replicated storage.

Other Related Work

  • The OPTIMA framework page: OPTIMA is an object-oriented framework that provides the necessary runtime support for open multithreaded transactions, a transaction model for concurrent object-oriented progamming. OPTIMA uses the stable storage implementation for storing the transactional log.
  • Open Multithreaded Transactions: A Transaction Model for Concurrent Object-Oriented Programming, Ph.D. Thesis no 2393, Swiss Federal Institute of Technology Lausanne, April 2001.

Publications

  1. Jörg Kienzle and Alexander Romanovsky, "A Framework Based on Design Patterns for Providing Persistence in Object-Oriented Programming Languages'', submitted to JMLC 2000. abstract+file
  2. Jörg Kienzle and Alexander Romanovsky, "On Persistent and Reliable Streaming in Ada'', International Conference on Reliable Software Technologies - Ada-Europe'2000, Potsdam, Germany, June 26-30, 2000, Lecture Notes in Computer Science, to be published. abstract+file
  3. Jörg Kienzle and Alexander Romanovsky, "Object Persistence: A Framework Based on Design Patterns'', Poster A0, submitted to ECOOP 2000. abstract+file

EPFL | IC | LGL | Research
URL: http://lgl.epfl.ch/research/ongoing/persistence.html
Last modified 8/20/2001, J. Kienzle.