Trustworthy Proxies

Virtualizing Objects with Invariants
  • Tom Van Cutsem
  • Mark S. Miller
Conference paper

DOI: 10.1007/978-3-642-39038-8_7

Part of the Lecture Notes in Computer Science book series (LNCS, volume 7920)
Cite this paper as:
Van Cutsem T., Miller M.S. (2013) Trustworthy Proxies. In: Castagna G. (eds) ECOOP 2013 – Object-Oriented Programming. ECOOP 2013. Lecture Notes in Computer Science, vol 7920. Springer, Berlin, Heidelberg

Abstract

Proxies are a common technique to virtualize objects in object-oriented languages. A proxy is a placeholder object that emulates or wraps another target object. Both the proxy’s representation and behavior may differ substantially from that of its target object.

In many OO languages, objects may have language-enforced invariants associated with them. For instance, an object may declare immutable fields, which are guaranteed to point to the same value throughout the execution of the program. Clients of an object can blindly rely on these invariants, as they are enforced by the language.

In a language with both proxies and objects with invariants, these features interact. Can a proxy emulate or replace a target object purporting to uphold such invariants? If yes, does the client of the proxy need to trust the proxy to uphold these invariants, or are they still enforced by the language? This paper sheds light on these questions in the context of a Javascript-like language, and describes the design of a Proxy API that allows proxies to emulate objects with invariants, yet have these invariants continue to be language-enforced. This design forms the basis of proxies in ECMAScript 6.

Keywords

Proxies Javascript reflection language invariants membranes 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Tom Van Cutsem
    • 1
  • Mark S. Miller
    • 2
  1. 1.Vrije Universiteit BrusselBelgium
  2. 2.Google ResearchUSA

Personalised recommendations