Uni-Logo

Transparent Object Proxies for JavaScript

by Matthias Keil and Peter Thiemann

A proxy, or wrapper, is an object that mediates access to an arbitrary target object. Proxies are widely used to perform resource management, access remote objects, impose access control, restrict the functionality of an object, or to enhance the interface of an object. Ideally, a proxy is not distinguishable from other objects so that running a program with an interposed proxy should lead to the same outcome as running the program with the target object, unless the proxy imposes restrictions.

Proxies introduce a subtle problem. Because a target object may have any number of proxy objects, which are all different from the target, a single target object may obtain multiple identities---it suffers from schizophrenia! Even worse, it turns out that there is no single cure for this schizophrenia because the desired behavior depends on the use case.

Unfortunately, current proxy implementations are committed to particular use cases, which makes it hard to adapt them to uses with different requirements. We discuss two such use cases in the context of the JavaScript proxy API, identify its shortcomings, and propose a solution.

Software Download

Publications

Research Paper

Artifacts

Related Work