arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1310.7774cs.PL
收藏

Ghost:一个统一的通用代理实现

Ghost: A Uniform and General-Purpose Proxy Implementation

Mariano Martinez Peck, Noury Bouraqadi, Stéphane Ducasse, Luc Fabresse, Marcus Denker

摘要:

代理对象是控制对另一个目标对象的访问的代理项或占位符。代理对象是一种广泛使用的解决方案,用于不同的场景,如远程方法调用,未来对象,行为反射,对象数据库,语言间通信和绑定,访问控制,惰性或并行评估,安全性等。大多数代理实现支持常规对象的代理,但无法为在运行时基础结构中具有重要角色的对象(如类或方法)创建代理。代理安装起来可能很复杂,它们可能有很大的开销,它们可能被限制在某些类中,等等。此外,代理实现通常没有分层,它们在代理(拦截消息的对象)和处理程序(处理拦截的对象)之间没有明确的分离。在本文中,我们提出了幽灵:一个统一的和通用的代理实现的Pharo程序设计语言。Ghost为常规对象以及类和方法提供了低内存消耗的代理。当代理代替类时,它会拦截类接收到的消息,以及对类实例接收到的消息的方法的查找。类似地,如果一个代理代替了一个方法,那么这个方法的执行也会被拦截。

英文摘要:

A proxy object is a surrogate or placeholder that controls access to another target object. Proxy objects are a widely used solution for different scenarios such as remote method invocation, future objects, behavioral reflection, object databases, inter-languages communications and bindings, access control, lazy or parallel evaluation, security, among others. Most proxy implementations support proxies for regular objects but are unable to create proxies for objects with an important role in the runtime infrastructure such as classes or methods. Proxies can be complex to install, they can have a significant overhead, they can be limited to certain kind of classes, etc. Moreover, proxy implementations are often not stratified and they do not have a clear separation between proxies (the objects intercepting messages) and handlers (the objects handling interceptions). In this paper, we present Ghost: a uniform and general-purpose proxy implementation for the Pharo programming language. Ghost provides low memory consuming proxies for regular objects as well as for classes and methods. When a proxy takes the place of a class, it intercepts both the messages received by the class and the lookup of methods for messages received by its instances. Similarly, if a proxy takes the place of a method, then the method execution is intercepted too.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑