Respectful Type Converters For Mutable Types

Abstract

In converting an object of one type to another, we expect some of the original object's behavior to remain the same, and some to change. How can we state the relationship between the original object and converted object to characterize what information is preserved and what is lost after the conversion takes place? We answer this question by introducing the new relation, respects, and say that a type converter function K : A to B respects a type T. We formally define respects in terms of the Liskov and Wing behavioral notion of subtyping; types A and B are subtypes of T. In previous work we defined respects for immutable types A, B, and T; in this paper we extend our notion to handle conversions between mutable types. This extension is non-trivial since we need to consider an object's behavior as it varies over time. We present in detail two examples to illustrate our ideas: one for converting between PNG images and GIF images and another for converting between different kinds of bounded event queues. We also discuss in less detail other real-world applications, namely those inspired by our Typed Object Model (TOM) conversion service built at Carnegie Mellon and by the infamous Year 2000 (Y2K) problem.

Open PDF

Document Details

Document Type
Technical Report
Publication Date
Jun 01, 1999
Accession Number
ADA366246

Entities

People

  • Jeannette Wing
  • John Ockerbloom

Organizations

  • Carnegie Mellon University

Tags

Communities of Interest

  • C4I

DTIC Thesaurus Topics

  • Abstracts
  • Air Force
  • Birds
  • Computer Programming
  • Computer Programs
  • Computer Science
  • Computers
  • Conversion
  • Converters
  • Hierarchies
  • Language
  • Programming Languages
  • Specifications
  • Web Browsers
  • Websites
  • Word Processors
  • World Wide Web

Fields of Study

  • Computer science

Readers

  • Computational Linguistics
  • Image Processing and Computer Vision.
  • Theoretical Analysis.