Trustworthy Proxies - Virtualizing Objects with Invariants

Trustworthy Proxies - Virtualizing Objects with Invariants
复制标题

值得信赖的代理 - 具有不变量的虚拟化对象

DOI:
10.1007/978-3-642-39038-8_7
复制
发表时间:
2013
期刊:
Proceedings 2022 Network and Distributed System Security Symposium
影响因子:
--
通讯作者:
Mark S. Miller
Mark S. Miller
中科院分区:
--
文献类型:
--
作者:
T. V. Cutsem;Mark S. Miller

文献摘要

被引文献

相似文献

代理是以面向对象的语言虚拟化对象的常见技术。代理是模拟或包装另一个目标对象的占位符对象。代理的表示和行为都可能与其目标对象的代理有很大不同。 在许多OO语言中,对象可能具有与之相关的语言强制性不变。例如,一个对象可以声明不变字段,该字段可以保证在程序的整个执行过程中指向相同的值。对象的客户可以盲目依靠这些不变性,因为它们是由语言强制执行的。 在具有代理和具有不变的对象的语言中,这些功能相互作用。代理可以模仿或替换声称要维护此类不变的目标对象吗?如果是,代理人的客户是否需要信任代理来维护这些不变性,或者他们仍然被语言执行?本文在类似JavaScript的语言的背景下阐明了这些问题,并描述了代理API的设计,该API允许代理可以用不变性模仿对象,但是这些不变的人仍继续使用语言强制。该设计构成了Ecmascript 6中代理的基础。
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.